My board uses ATtiny45 (datasheet).
Information that I find important and useful:
I used Arduino IDE. There are two main parts in the code: the setup and the loop. (there may be a third part in which you can include libraries).
Setup: runs once when the board is powered or reset. Variables are initializaed in the setup.
Loop: runs continuously, executing the commands line after line until it reaches the last line and starts again at the first one.
I started with the "Hello world" of electronics: the blink code. In the setup, the command pinMode establishes the indicated pin (0 in this case) as output, meaning the microcontroller will send digital signals to this pin. The, the loop section has the commands to put pin 0 to HIGH state, wait for 1 second, put pin 0 to LOW state, wait for 1 second, and repeat.
In this case, HIGH and LOW mean a voltage of about 5 V and 0 V respectively, and because a LED is conected between pin0 and GND, the LED will be on and off according to the state set by the program.
This is the code for the blink program:
void setup()
{
pinMode(0, OUTPUT);
}
void loop()
{
digitalWrite(0, HIGH);
delay(1000);
digitalWrite(0, LOW);
delay(1000);
}
What questions do you have?
What other microcontroller is available to make a bigger board?
I used the ATMega328 for later assignments, and came back to coplete this one
What would you like to learn more about?
I would like to learn more about other programming languages, besides the arduino code.
When my fabduino was ready (week 15) I came back to this assignment and programmed a lights sequence.
I used Arduino IDE. There are two main parts in the code: the setup and the loop. (there may be a third part in which you can include libraries).
Setup: runs once when the board is powered or reset. Variables are initializaed in the setup.
Loop: runs continuously, executing the commands line after line until it reaches the last line and starts again at the first one.
I created the code, wich basically declares tree int variables, one for each led pin, and then the loop turns on and off each light in a sequences. The program has a delya of half a second between each change.
This is the code for the lights sequence:
int led1 = 2;
int led2 = 3;
int led3 = 4;
void setup()
{
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
}
void loop()
{
digitalWrite(led1, HIGH);
delay(500);
digitalWrite(led1, LOW);
delay(500);
digitalWrite(led2, HIGH);
delay(500);
digitalWrite(led2, LOW);
delay(500);
digitalWrite(led3, HIGH);
delay(500);
digitalWrite(led3, LOW);
delay(500);
digitalWrite(led2, HIGH);
delay(500);
digitalWrite(led2, LOW);
delay(500);
}