To program the board, I plugged in USBtinyISP, just as I had done in week 8 and ran the Blink sample to see if there is no communication error.
In my watch, I am using 3 pins of Attiny output and 2 resistors to control 12 LEDs.
Each pin is connected to 4 different Leds. And 2 of these LEDs are connected to one resistor and the other two to another resistor.
As we can see in the figure on the side.
To start programming, it was necessary to make a matrix, to separate all the LEDs, and to make them light them every hour.
The 2 resistors are defined as:
B00001000 = PA3 (pin A3 Arduino)
B00000100 = PA2 (Arduino A2 pin)
The 3 output pins of the LEDS are defined as:
B0001 = PB0 (pin 10 Arduino)
B0010 = PB1 (pin 9 Arduino)
B0100 = PB2 (pin 8 Arduino)
The combined connections according to the code will cause the 12 LEDs to light, one at a time.
I wrote the following code for my watch.
* It is necessary to download the "Time-master" library for the Arduino and #include TimeLib.h. Download here!
Download the code to use, here: week11_watch.gcode _3D print, Arduino file
The first experiences I made with the LEDs, went well, although some LEDs are switched and some LEDs light up two at a time.
The video shows the problem.
I switched the LEDs and fixed some connections with the GND that were in conflict. And everything went well :)