Modifications

Sauter à la navigation Sauter à la recherche
1 444 octets ajoutés ,  21 décembre 2014 à 19:17
Page créée avec « {{Spark.IO-CLI-NAV}} {{traduction}} {{bloc-etroit|text=If you're just opening a new core, chances are it's already loaded with Tinker, the app we load at the factory. If yo... »
{{Spark.IO-CLI-NAV}}

{{traduction}}

{{bloc-etroit|text=If you're just opening a new core, chances are it's already loaded with Tinker, the app we load at the factory. If you don't have Tinker, or if you've been using the build IDE already, let's load it quickly by typing:}}

<nowiki># How to re-load tinker onto a core
$ spark flash my_new_core_name tinker
Including:
/usr/local/lib/node_modules/spark-cli/binaries/spark_tinker.bin
attempting to flash firmware to your core my_new_core_name
flash core said {"id":"0123456789ABCDEFGHI","status":"Update started"}</nowiki>

{{bloc-etroit|text=Let's make sure your core is online and loaded with Tinker. We should see the four characteristic functions exposed by Tinker, "digitalwrite", "digitalread", "analogwrite", and "analogread".}}

<nowiki># how to show all your cores and their functions and variables
$ spark list

Checking with the cloud...
Retrieving cores... (this might take a few seconds)
my_core_name (0123456789ABCDEFGHI) 0 variables, and 4 functions
Functions:
int digitalread(String args)
int digitalwrite(String args)
int analogread(String args)
int analogwrite(String args)</nowiki>

{{bloc-etroit|text=Nice! You should have seen the small blue LED turn on, and then off.}}

<nowiki># how to call a function on your core
$ spark call my_core_name digitalwrite D7,HIGH
1
$ spark call my_core_name digitalwrite D7,LOW
1</nowiki>


{{Spark.IO-CLI-TRAILER}}
29 918

modifications

Menu de navigation