samedi 30 octobre 2010

Here i'am making the word AMOUR blink on the lily pad :
Je fait clignoter le mot amour en morse
here is the code :
voila le code :


/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.

This example code is in the public domain.
*/
// declaration des variables
int court = 500;
int longue = 2000;
int pause = 1000;
// initialisation du matos dans le setup
void setup() {
// initialize the digital pin as an output.
// pin 13 correspond a la led de la CM
// Pin 13 has an LED connected on most Arduino boards:
// pinmode declare la pin 13 output
pinMode(13, OUTPUT);

}

void loop() {
// On ecrit la lettre A
// high correpond a on
digitalWrite(13, HIGH); // set the LED on
// en milli seconde
delay(court); // wait for a second
// je l'eteint pendant une seconde
digitalWrite(13, LOW); // set the LED off
delay(pause); // wait for a second
digitalWrite(13, HIGH); // set the LED on
// en milli seconde
delay(longue); // wait for a second
// je l'eteint pendant une seconde
digitalWrite(13, LOW); // set the LED off
delay(pause); // wait for a second

// On ecrit la lettre M :
digitalWrite(13, HIGH); // set the LED on
// en milli seconde
delay(longue); // wait for a second
// je l'eteint pendant une seconde
digitalWrite(13, LOW); // set the LED off
delay(pause); // wait for a second
digitalWrite(13, HIGH); // set the LED on
// en milli seconde
delay(longue); // wait for a second
// je l'eteint pendant une seconde
digitalWrite(13, LOW); // set the LED off
delay(pause); // wait for a second


// On ecrit la lettre O
digitalWrite(13, HIGH); // set the LED on
// en milli seconde
delay(longue); // wait for a second
// je l'eteint pendant une seconde
digitalWrite(13, LOW); // set the LED off
delay(pause); // wait for a second
digitalWrite(13, HIGH); // set the LED on
// en milli seconde
delay(longue); // wait for a second
// je l'eteint pendant une seconde
digitalWrite(13, LOW); // set the LED off
delay(pause); // wait for a second
digitalWrite(13, HIGH); // set the LED on
// en milli seconde
delay(longue); // wait for a second
// je l'eteint pendant une seconde
digitalWrite(13, LOW); // set the LED off
delay(pause); // wait for a second

// on ecrit la lettre U
digitalWrite(13, HIGH); // set the LED on
// en milli seconde
delay(court); // wait for a second
// je l'eteint pendant une seconde
digitalWrite(13, LOW); // set the LED off
delay(pause); // wait for a second
digitalWrite(13, HIGH); // set the LED on
// en milli seconde
delay(court); // wait for a second
// je l'eteint pendant une seconde
digitalWrite(13, LOW); // set the LED off
delay(pause); // wait for a second
digitalWrite(13, HIGH); // set the LED on
// en milli seconde
delay(longue); // wait for a second
// je l'eteint pendant une seconde
digitalWrite(13, LOW); // set the LED off
delay(pause); // wait for a second


// on ecrit la lettre R
digitalWrite(13, HIGH); // set the LED on
// en milli seconde
delay(court); // wait for a second
// je l'eteint pendant une seconde
digitalWrite(13, LOW); // set the LED off
delay(pause); // wait for a second
digitalWrite(13, HIGH); // set the LED on
// en milli seconde
delay(longue); // wait for a second
// je l'eteint pendant une seconde
digitalWrite(13, LOW); // set the LED off
delay(pause); // wait for a second
digitalWrite(13, HIGH); // set the LED on
// en milli seconde
delay(court); // wait for a second
// je l'eteint pendant une seconde
digitalWrite(13, LOW); // set the LED off
delay(pause); // wait for a second
}

Bussiere

Aucun commentaire:

Enregistrer un commentaire