How to start
How to configure Smick and write my first program
In this section you will learn how to configure Smick and write your first sketch.
The Smick configuration (optional) is divided into 4 steps:
- Smick driver installation on PC: to run every time you connect Smick to a new PC;
- configuration of the serial terminal: to be executed every time you connect Smick on a different USB port of the PC;
- configuration of the Wi-Fi connection (ssid and pasword) on Smick: to be executed every time you connect Smick to a new Wi-Fi router;
- configuration of the MQTT broker on Smick: to be executed every time you connect Smick to a new MQTT broker.
In step 5 you will write, execute and memorize your first sketch.
1. Smick driver installation on PC
(1) Connect Smick to the PC with a micro USB cable
(2) The LED will indicate its status:
- Quick flashing indicates connection to Wi-Fi router
- Slow Flashing indicates connection to MQTT Broker
- Flash every 3 seconds indicates Execution mode
2. Configuration of the serial terminal
(4) To open the serial terminal run
(5) The window of the interpreter K appears
Use it to program and configure Smick
3. Configuration of the Wi-Fi connection (ssid and password) on Smick
(6) Set the credentials of the Wi-Fi router and store them
4. Configuration of the MQTT broker on Smick
(7) Set the credentials of the MQTT broker and store them
(8) enable Wi-Fi connection
WIFI WiFi connection to 'mySSID' enabled
Wait a few seconds for it to connect to the Wi-Fi router and the MQTT broker (see how the LED behaves in the various phases)
WIFI connected with IP: 192.168.1.142
NTP connecting to 0.it.pool.ntp.org
NTP date and time updated 07-09-2017 00:22:46
OTA Check firmware update
OTA no updates
MQTT connecting to m20.cloudmqtt.com:14596
MQTT user: smick, client-ID: Smick-217650678
MQTT uses user-defined feeds
MQTT subscribe to: I35232
MQTT publish on: O35232
Now Smick is connected and ready: start creating your first sketch.
5. Your first sketch
Define the start command
] start=[led=!led #1]
and run it
The status LED starts to flash every second
You have created your first sketch!
If you wish to memorize it enter the command
If you now turn off Smick (extract the USB cable from the PC) and turn it on again (insert the USB cable into the PC) your sketck will be executed automatically.
To understand the command created, stop it with
and try the following commands:
the LED lights up
the LED goes out
the LED lights up because:
- led was 0,
- ! is the negation operator then !led = !0 = 1
- therefore led = !led = !0 = 1
] led=!led #1
The operatore #1 repeats to infinity the command that precedes it once a second.