Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions 02_Connecting to Wifi/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# 02_Connecting_to_Wifi
This program is to connect to WiFi using NodeMCU
To run the program use the following ampy command


```bash
ampy --port /dev/tty.SLAB_USBtoUART run wifi_connect.py
```
9 changes: 9 additions & 0 deletions 02_Connecting to Wifi/wifi_connect.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import network
sta_if = network.WLAN(network.STA_IF)
if not sta_if.isconnected():
print('Connecting to network...')
sta_if.active(True)
sta_if.connect('<Your ESSID>', '<Password>')
while not sta_if.isconnected():
pass
print('Network config:', sta_if.ifconfig())
10 changes: 10 additions & 0 deletions 03_RGB_LED/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# 02_RGB_LED_COLOUR_VARIATIONS
- This program is for controlling RGB LED using NodeMCU
- Run this program after setting up the hardware part. For more information visit :
[Controlling RGB LED using NOdeMCU](https://blog.thepodnet.com/nodemcu-rgb-led-using-micropython/)

After setting up the circuit, run the program by using following ampy command in terminal

```bash
ampy --port /dev/tty.SLAB_USBtoUART run rgb_led.py
```
20 changes: 20 additions & 0 deletions 03_RGB_LED/rgb_led.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import machine
import time

blue = machine.Pin(14, machine.Pin.OUT)
red = machine.Pin(12, machine.Pin.OUT)
green = machine.Pin(13, machine.Pin.OUT)

while True:
green.on()
time.sleep_ms(500)
green.off()
time.sleep_ms(500)
blue.off()
time.sleep_ms(500)
blue.on()
time.sleep_ms(500)
red.on()
time.sleep_ms(500)
red.off()
time.sleep_ms(500)