For this week assignment I have used a light sensor and my hello-world board.
I made 2 programs to use the lightsensor, one using the digital read and other programmed to use the analog read. This two softwares are useful for different applications, for instance the digital read is useful when you want to know if there is complete darkness on the other hand the analog read gives you the chance to detect an specific range in this case of light intensity according to pre established parameters.
The data sheet of the ATtiny 84 was useful to identify where the connections had to be made.
You can download the files HERE
The digital program (as shown in a video below) was designed to turn on and off the LED. If the Arduino IDE monitor serie is open it will show a 1 or 0 depending on what is the sensor detecting.
In the analog program two differences can be found, the first is the intensity variation that the LED has related directly with the light intensity detected by the sensor, the second one is how it shows data on the serial monitor that goes from 0 to 1024.
3 - 3
After testing my connection on the protoboard I made the circuit using a copper board and the Modela machine and EAGLE software.
I connected this circuit to my hello-wolrd board which had my program already charged.
As it's shown in the video below I programmed the sensor to work in a digital way but it could be also programmed as shown in the video above as an analog sensor.