{{bloc-etroit|text=You can write whole apps and flash them remotely from the command line just as you would from the build IDE. Let's write a small blink sketch to try it out.
+
{{bloc-etroit|text=Vous pouvez également utiliser la ligne de commande pour créer une application puis la flasher à distance avec <code>spark flash</code> pour obtenir un résultat identique à celui obtenu avec l'IDE build.
−
Copy and paste the following program into a file called '''blinky.ino'''}}
+
Ecrivons un petit programme "blinky" (clignotement) pour essayer.
−
<nowiki>#Copy me to blinky.ino
+
Copiez et collez le programme suivant dans un fichier nommé '''blinky.ino'''}}
−
#define PIN D7
+
+
<nowiki>#Copiez moi dans blinky.ino
+
#DEFINE PIN D7
int state = 0;
int state = 0;
void setup() {
void setup() {
−
//tell the core we want to write to this pin
+
//Informons le core que nous voulons écrire sur cette broche
pinMode(PIN, OUTPUT);
pinMode(PIN, OUTPUT);
}
}
void loop() {
void loop() {
−
//alternate the PIN between high and low
+
//alterner l'état de la broche entre niveau haut (high) et bas (low)