Capitolo 1 (non mi avrai Lechuck!)
Here is an instant blog, usually I’m not really persistent, so I suppose I’ll give up when I won’t have to use this blog anymore.
I’m doing it cause I have too
I will put notes about the progress I’m gonna make during a Phsical Computing course at my university, in Siena. We’re gonna learn how to use Arduino, or at least we’ll try to!
We were asked to make a blog to update every new step we do. Due to the open source nature of Arduino project we’ll pubblish all of our works with some explenations and all the code written during our workshops.
The blog’s layout is just a beta (will I ever change it?) and it’s liberally inspired to Monkey island, one of the best videogames ever. There are two main reasons:
-there is a new MI game but I can’t use it cause my laptop is still broken and I’m using an older one right now
-MI nature (expecially in the first two chapters of the game) is in a way similar to the work we’re gonna do. You had to mix different things, learn by doing, try all kinds of connections before finding the right one, getting more and more involved in the project you were in and so on…
So, in this first day we just did some basics. I’m probably gonna use many wrong terms, I hope I’ll improve day by day.
In the first picture (bottom of the page) here you can see how I just connected the external areas of the board in order to make a anode\cathode circuit (I think…)
After that i connected it to Arduino wiring the 13th digital pin slot to one circuit in the board and the GND slot to the other circuit. Arduino signal was then arriving to the board (where I put a led respectin the anode\cathode corrispondence) and I opened an example of code from file\examples\digital\blink, from the Arduino software.
There was my first blinking!
After that we found out that it is possible to add some more leds to the same circuit, but that might overload the processor, you need 220r resistor in circuit with every led in order to avoid an overload.
So..we had to connect every resistor on the board with Arduino (in the 10-11-12 slots) on one side and on the same circuit of the led anode on the other side. Then we connected the leds cathode’s circuits with the GND slot and re-wrote the example code mentioned before.
We had to add a new element for every led we wanted to connect and the work was done, there were 3 blinking lights (in my case with different rithm) on the board!
Here is the code…I don’t know if is the shortest way to get to the result but it almost worked. I say almost cause the rithm i wanted for every light wasn’t respected. Every led had a long off moment and a short blink on. I might have made some mistake in the code but it was too late and I couldn’t figure out what happened nor asking to the prof. I will tomorrow, I guess.
int redpin = 12; // LED connected to digital pin 12
int greenpin = 11; //led connected to digital pin 11
int yellowpin=10; //led connected to digital pin 10
void setup() { // initialize the digital pin as an output:
pinMode(redpin, OUTPUT);
pinMode(yellowpin, OUTPUT);
pinMode(greenpin, OUTPUT);
}
// the loop() method runs over and over again,
// as long as the Arduino has power
void loop()
{
digitalWrite(redpin, HIGH); // set the LED on
delay(1000); // wait for a second
digitalWrite(redpin, LOW); // set the LED off
delay(1000); // wait for a second
digitalWrite(greenpin,HIGH); //set the greenled on
delay(400); //set the rithm
digitalWrite(greenpin,LOW); //set the green led off
delay(400); //set the rithm
digitalWrite(yellowpin,HIGH);
delay(500);
digitalWrite(yellowpin,LOW);
delay(500);
}
Finally here is a picture of the circuit(on the right)

That’s it for this first day, I hope I’ll post something more intersting (for who wasn’t there) tomorrow!


