The function creates an object to connect Quarky with Wi-Fi.
import iot
wifi = iot.wifi()
Function Definition: wifi()
The function creates an object to connect Quarky with Wi-Fi.
import iot
wifi = iot.wifi()
In this example, we look at how to establish and see if the Wi-Fi is connected to Quarky or not. The code will connect the Quarky to a specified Wi–Fi network and show a green status if the connection is successful, or a red status if the connection fails.
# imported modules
from quarky import *
import iot
# Create a Wi-Fi object
wifi = iot.wifi()
# Change the Wi-Fi Name and Password
wifi.connecttowifi("IoT", "12345678")
# Run the loop to check if the Wi-Fi is connected
while True:
# Check if the Wi-Fi is connected
if wifi.iswificonnected():
# Draw a pattern on the quarky
quarky.drawpattern("ccccccccccccccccccccccccccccccccccc")
else:
# Draw a different pattern on the quarky
quarky.drawpattern("bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb")
Copyright 2024 – Agilo Research Pvt. Ltd. All rights reserved – Terms & Condition | Privacy Policy