The block connects the Quarky or ESP32 to the specified Wi-Fi and password. The block is only available in the Upload Mode when the code is uploaded to Quarky.
In this example, we look at how to establish and see if the Wi-Fi is connected to Quarky or not.
In this example, we look at how to establish and see if the Wi-Fi is connected to Quarky or not.
Code
The following code can be used for it:
The following code is generated by PictoBlox:
# This python code is generated by PictoBlox
from quarky import *
# This python code is generated by PictoBlox
# imported modules
import iot
wifi = iot.wifi()
wifi.connecttowifi("IoT","12345678")
while True:
if wifi.iswificonnected():
quarky.drawpattern("ccccccccccccccccccccccccccccccccccc")
else:
pass
quarky.drawpattern("bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb")
Output
Troubleshooting
- If the Green Light comes, your Wi-Fi is connected.
- If the Red Light comes, your Wi-Fi is not connected. Change the Wi-Fi and the password and try again.
- If the Red Cross sign comes, Quarky, Python error has occurred. Check the serial monitor and try to reset the Quarky.
Read More