Shop

I sell on Tindie

Friday, July 1, 2022

Raspberry Pi Pico W - 2 Quick Projects to Get You Started

July 1st 2022

💖We love new arrivals! Here are two quick projects to get you started with the Raspberry Pi Pico W.

Tips
Make sure you Pi Pico W is set to the correct USB Serial Device (COM)
Select your board.


Optional: Install MicroPython firmware from Thonny IDE link. 














Blink an LED
Code:

#Blink LED on GPIO 0 - Connect an LED on Pin 1(GPIO 0) and Pin 3 (GND)

from machine import Pin, Timer

inbuiltLed = 0
led = Pin(0, Pin.OUT)
timer = Timer()
def ledblink(timer):
    led.toggle()
timer.init(freq=2.5, mode=Timer.PERIODIC, callback=ledblink)
  1. Web Server Ping

Code:
# Web Server Ping

import network
import socket
 
ssid = 'Your Router'
password = 'Your Password'
 
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect(ssid, password)
 
 
addr = socket.getaddrinfo('0.0.0.0', 80)[0][-1]
 
s = socket.socket()
s.bind(addr)
s.listen(1)
 
print('listening on', addr)
status = wlan.ifconfig()
print(status[0])
 
#Listen for Connections
while True:
    try:
        cl, addr = s.accept()
        print('client connected from', addr)
        request = cl.recv(1024)
        print(request)
        
        response = "Hello"
        
        cl.send('HTTP/1.0 200 OK/r/nContent-type: text/html\r\n\r\n')
        cl.send(response)
        cl.close()
    
    except OSError as e:
        cl.close()
        print('connection closed')
The Raspberry Pi Pico W is a new tiny platform based on the RP2040 silicon and it provides connectivity by integrating Infineon CYW43439 2.4 GHz Wi-Fi chip with an onboard antenna and a flexible digital interface, this means that no need for wires, it is uses the latest MicroPython release for the Pico W as it offers the easiest means to get online and do fun projects. 

🔋 Raspberry Pi Pico W I/O voltage is fixed at 3.3V

Find the PDF here: Connecting to the internet with Pico W

Raspberry Pi Pico W has been designed to be a low cost yet flexible development platform for RP2040, with the addition
of a 2.4GHz wireless interface and the following key features:
• RP2040 microcontroller with 2MB of external flash
• 📶On board 2.4GHz wireless (802.11n) interface 
• Micro-USB port for power and data (and for reprogramming the flash)
• 40-pin 21mm×51mm 'DIP' style 1mm thick PCB with 0.1 inch through-hole pins also with edge castellations
    • Exposes 26 multi-function 3.3V general purpose I/O (GPIO)
    • 23 GPIO are digital-only, with 3 more which also support ADC
    • Can be surface-mounted as a module

 


The two images from left to right are a 3D Model of Pico Pi W and breadboarded with 10mm LED.Raspberry Pi Pico Pinout 



 Raspberry Pi Pico W Dimensions

No comments:

Post a Comment

Add your opinion. What’s your main takeaway from the blog post?

Note: Only a member of this blog may post a comment.

Raspberry Pi Pico W - 2 Quick Projects to Get You Started

July 1st 2022 💖We love new arrivals! Here are two quick projects to get you started with the Raspberry Pi Pico W. Tips :  Get the latest fi...

Popular Post