Hardware/software used for this project (read the parts list for a more comprehensive list of hardware):
- AVR-GCC toolchain
- My T85 Target board (click here for the project page for the details of the board)
- a breadboard with a photoresistor, some jumper wires and a resistor
I've used avr-size to determine that my compiled program uses less than 1KB for the HaD 1kB challenge.
Interesting things that I've learned so far:
The internal temperature sensor in the Attiny85 (connected to ADC4) for my purposes makes a better seed source for random number generation than an ADC pin that's unconnected. Another plus to using the internal temperature sensor is that random number generation is unaffected by having my programmer plugged in/not plugged into my development board.
Char can be used in place of int if you only need to deal with numbers <= 255 which helps save on RAM usage.
The rand() function takes up less space than random() which allowed my program to to be within the 1 KB challenge limit, but still takes up quite a bit of flash compared to the rest of my program's code.