Modifications

Sauter à la navigation Sauter à la recherche
636 octets ajoutés ,  24 novembre 2014 à 21:29
Ligne 39 : Ligne 39 :     
In the picture above, we used a 1K resistor (Brown Black Red)
 
In the picture above, we used a 1K resistor (Brown Black Red)
 +
 +
== Le programme ==
 +
Voici une version du programme proposé par Spark... avec les commentaires traduits pour faciliter la compréhension.
 +
 +
<nowiki>// Program to blink an LED connected to pin D0
 +
// of the Spark Core.
 +
 +
// We name pin D0 as led
 +
int led = D0;
 +
 +
// This routine runs only once upon reset
 +
void setup()
 +
{
 +
  // Initialize D0 pin as output
 +
  pinMode(led, OUTPUT);
 +
}
 +
 +
// This routine loops forever
 +
void loop()
 +
{
 +
  digitalWrite(led, HIGH);  // Turn ON the LED
 +
  delay(1000);              // Wait for 1000mS = 1 second
 +
  digitalWrite(led, LOW);    // Turn OFF the LED
 +
  delay(1000);              // Wait for 1 second
 +
}</nowiki>
       
{{Spark-Core-Hacking-TRAILER}}
 
{{Spark-Core-Hacking-TRAILER}}
29 879

modifications

Menu de navigation