You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/arduino-cloud/01.guides/04.micropython/content.md
+4-2
Original file line number
Diff line number
Diff line change
@@ -61,7 +61,7 @@ Next step is to create some Cloud variables, which we will later interact with v
61
61
1. While in Thing configuration, click on **"Add Variable"** which will open a new window.
62
62
2. Name your variable `led` and select it to be of an `boolean` type.
63
63
3. Click on **"Add Variable"** at the bottom of the window.
64
-
4. Create another variable, name it `ledSwitch` and select it to be `int` type.
64
+
4. Create another variable, name it `ledSwitch` and select it to be `boolean` type.
65
65
66
66
You should now have **two variables**:
67
67
-`led` - boolean
@@ -153,6 +153,8 @@ led = Pin("LEDB", Pin.OUT) # Configure the desired LED pin as an output.
153
153
defon_switch_changed(client, value):
154
154
# Toggles the hardware LED on or off.
155
155
led.value(not value)
156
+
# Depending on the board you use you may need to use "led.value(value)" instead
157
+
# so that the LED's state reflects correctly the boolean value.
156
158
157
159
# Sets the value of the Cloud variable "led" to the current state of the LED
158
160
# and thus mirrors the hardware state in the Cloud.
@@ -223,4 +225,4 @@ If the code is not working, there are some common issues we can troubleshoot:
223
225
224
226
## Conclusion
225
227
226
-
This tutorial has guided you through the process of connecting your Arduino device to the Arduino Cloud using MicroPython. You learned how to install the necessary library, set up your device, and control an LED via the Arduino Cloud. This opens up possibilities for more complex applications, as you can control and monitor your Arduino device remotely.
228
+
This tutorial has guided you through the process of connecting your Arduino device to the Arduino Cloud using MicroPython. You learned how to install the necessary library, set up your device, and control an LED via the Arduino Cloud. This opens up possibilities for more complex applications, as you can control and monitor your Arduino device remotely.
0 commit comments