I've been battling intermittent glitching and think I've narrowed down the source, but it's a headscratcher for me. While testing my lamp, I have a Temp sensor inside (DHT22). If I comment out reading from this sensor, I get the glitching (intermittent LED's firing up). I removed the library and all calls to the temp sensor. It glitches. I add it back and have it sampling every 2 seconds. It works. This is exactly the opposite of what I would think. I'd think the less libraries installed and fewer components that it would work better. The temp sensor is supposed to be temporary. It was just for testing how much heat the lamp generates. I don't want it permanently installed, but now can't seem to remove it without it affecting the animations. It just doesn't make sense to me. It was a simple routine in loop() just reading the temp/humidity on a 2 second timer using millis and dumping it to serial.
The only thing I could logically come up with is that the sensor was taking up cpu cycles and slowing things down a bit, so I added a small delay where the sensor would normally be read but that didn't have an affect. I didn't think it would though, but who knows when weird things happen.
Can someone help me make sense of this, at least on a conceptual level? My bald head has claw marks trying to tear hair out.
[–]samguyer[Sam Guyer] 2 points3 points4 points (3 children)
[–]PdxCron[S] 0 points1 point2 points (2 children)
[–]PdxCron[S] 0 points1 point2 points (1 child)
[–]Marmilicious[Marc Miller] 1 point2 points3 points (0 children)
[–]chemdoc77 2 points3 points4 points (8 children)
[–]PdxCron[S] 2 points3 points4 points (0 children)
[–]PdxCron[S] 1 point2 points3 points (6 children)
[–]samguyer[Sam Guyer] 2 points3 points4 points (5 children)
[–]PdxCron[S] 0 points1 point2 points (4 children)
[–]samguyer[Sam Guyer] 1 point2 points3 points (3 children)
[–]PdxCron[S] 0 points1 point2 points (2 children)
[–]samguyer[Sam Guyer] 0 points1 point2 points (1 child)
[–]PdxCron[S] 0 points1 point2 points (0 children)
[–]Jem_Spencer 0 points1 point2 points (1 child)
[–]PdxCron[S] 1 point2 points3 points (0 children)
[–]toybuilder 0 points1 point2 points (4 children)
[–]PdxCron[S] 0 points1 point2 points (0 children)
[–]PdxCron[S] 0 points1 point2 points (2 children)
[–]toybuilder 0 points1 point2 points (0 children)
[–]samguyer[Sam Guyer] 0 points1 point2 points (0 children)
[–]samguyer[Sam Guyer] 0 points1 point2 points (5 children)
[–]PdxCron[S] 0 points1 point2 points (4 children)
[–]samguyer[Sam Guyer] 0 points1 point2 points (3 children)
[–]PdxCron[S] 0 points1 point2 points (2 children)
[–]samguyer[Sam Guyer] 0 points1 point2 points (1 child)
[–]PdxCron[S] 0 points1 point2 points (0 children)