Modifications

Sauter à la navigation Sauter à la recherche
2 269 octets ajoutés ,  8 décembre 2014 à 09:34
Page créée avec « {{Spark.IO-Build-NAV}} == Un bout de code == {{bloc-etroit|text=The best way to get started with the IDE is to start writing code: * Connect: Make sure your Core is powered... »
{{Spark.IO-Build-NAV}}

== Un bout de code ==
{{bloc-etroit|text=The best way to get started with the IDE is to start writing code:

* Connect: Make sure your Core is powered and "breathing" Cyan, which indicates that it's connected to the Spark Cloud and ready to be updated.
* Get Code: Try clicking on the "Blink an LED" example under the "Example apps" header. The Spark Build editor should display the code for the example application in an active tab. Alternatively, you can copy and paste this snippet of code into a new application in the Build IDE.

}}

<nowiki>//D7 LED Flash Example
int LED = D7;

void setup() {
pinMode(LED, OUTPUT);
}

void loop() {
digitalWrite(LED, HIGH);
delay(1000);
digitalWrite(LED, LOW);
delay(1000);
}</nowiki>

== Votre Core & Flasher ==
{{SPARKImage|Spark.IO-Build-WebIde-30.png|480px}}

* '''Select Your Core''': The next step is to make sure that you've selected which of your Cores to flash code to. Click on the "Cores" icon at the bottom left side of the navigation pane, and click on the star next to the Core you'd like to update. Once you've selected a Core, the star associated with it will turn yellow. (If you only have one core, there is no need to select it, you can continue on to the next step).
* '''Flash''': Click the "Flash" button, and your code will be sent wirelessly to your Core. If the flash was successful, the LED on your Core will begin flashing magenta.

== Fork & modification ==
{{SPARKImage|Spark.IO-Build-WebIde-31.png|480px}}

Un [http://fr.wikipedia.org/wiki/Fork_%28d%C3%A9veloppement_logiciel%29 fork], ou embranchement, est un nouveau logiciel créé à partir du code source d'un logiciel existant. (cfr ''Wikipedia.fr'')

* '''Fork''': Wish the timing of that LED flash was a little bit faster? Try clicking on the "Fork This Example" button after selecting the "Blink An LED" example application. You've now got a personal copy of that application that you can modify, save, and flash to all of your Cores.
* '''Edit''': Try changing the values in the delay() function from 1000 to 250, which changes the timing interval from 1000 milliseconds to only 250 milliseconds. Click the Verify button, then the Flash button. Is your Core's LED blinking faster? Well done :)
29 918

modifications

Menu de navigation