Really, I'll grab whatever is necessary to be able to debug via ArduinoISP in serial, blinking LEDs for debugging gets real old real fast.
Of course, I've got the fan controller attiny85 OSCCAL'd low enough that serial is probably a lost cause.
Difficult to say. You haven't provided enough information. Which core did you decide to use? What serial-to-USB converter are you using? How do you have the converter connected?
fadeLight is always a negative int value bounded to zero.
if (soundLevel >= threshold)
analogWrite does not clamp the value so, when the value changes from -256 to -257 the value actually written to the hardware goes from 0 (full off) to 255 (full on).
There is an assumption that the fading stops at -90 but that may not be true because of the next problem...
Finally, I doubt the application will be running continuously for 49 days but, if it is, it will not work correctly. millis values and addition (and direct comparison) do not mix.
Serial ala ... ATtiny85 simply connected to the Arduino Uno, connected to the PC via USB.
A huge thank you for your invaluable help Coding Badly!
Where do the values -256 and -257 come from? I assumed the limit for analogWrite was 255?
But from a technical standpoint I'm interested to know what I can do to make the code work indefinitely. What happens after 49 days? Does millis not simply reset to zero?
I'm in the process of adding "serial relay" to the Arduino ISP Sketch.
Until then, you can use the Uno as a serial converter. Hold the processor in reset by connecting a jumper between RESET and GND. Connect the serial output from the ATtiny85 to pin 1 on the Uno. The ATtiny85 and the Uno will have to have the grounds connected. You should then be able to use a terminal program to collect output from the ATtiny85.
Please enter a valid email to subscribe
We need to confirm your email address.
To complete the subscription, please click the link in the
email we just sent you.
Thank you for subscribing!
via Egeo 16