# data[].attributes.body
파일을 다운받아 설치하세요

# data[].attributes.headline
라즈베리파이 피코 자료

# data[].attributes.subject
라즈베리파이 피코 자료

# data[].attributes.body
라즈베리파이 피코 사이트

라즈베리파이 피코 문서(영문)
https://www.raspberrypi.com/documentation/microcontrollers/

# data[].attributes.attachment_link.readable_text
Powerful, flexible microcontroller boards, available from $4

The Raspberry Pi Pico series is a range of tiny, fast, and versatile boards built using RP2040, the flagship microcontroller chip designed by Raspberry Pi in the UK

From light displays and IoT devices to signage and manufacturing processes, the Raspberry Pi Pico series gives you the power to control countless home, hobby, and industrial operations.

Programmable in C and MicroPython, Pico is adaptable to a vast range of applications and skill levels, and getting started is as easy as dragging and dropping a file.

More experienced users can take advantage of Raspberry Pi Pico's rich peripheral set, including SPI, I2C, and eight Programmable I/O (PIO) state machines for custom peripheral support.

Now available with wireless connectivity or pre-soldered headers, for even more flexibility in your projects.

Specification

21 mm × 51 mm form factor

RP2040 microcontroller chip designed by Raspberry Pi in the UK

Dual-core Arm Cortex-M0+ processor, flexible clock running up to 133 MHz

264kB on-chip SRAM

2MB on-board QSPI flash

2.4GHz 802.11n wireless LAN (Raspberry Pi Pico W and WH only)

26 multifunction GPIO pins, including 3 analogue inputs

2 × UART, 2 × SPI controllers, 2 × I2C controllers, 16 × PWM channels

1 × USB 1.1 controller and PHY, with host and device support

8 × Programmable I/O (PIO) state machines for custom peripheral support

Supported input voltage 1.8-5.5V DC

Operating temperature -20°C to +85°C (Raspberry Pi Pico and Pico H); -20°C to +70°C (Raspberry Pi Pico W and Pico WH)

Castellated module allows soldering direct to carrier boards (Raspberry Pi Pico and Pico W only)

Drag-and-drop programming using mass storage over USB

Low-power sleep and dormant modes

Accurate on-chip clock

Temperature sensor

Accelerated integer and floating-point libraries on-chip

Documents

Compliance

Raspberry Pi Pico has undergone extensive compliance testing and meets a number of regional and international standards.

View and download relevant certificates and conformity documents.
If you require any further information regarding compliance, please contact us at compliance@raspberrypi.com

Obsolescence

Raspberry Pi Pico series will remain in production until at least January 2034

# data[].attributes.attachment_link.description
Powerful, flexible microcontroller boards, available from $4 The Raspberry Pi Pico series is a range of tiny, fast, and versatile boards built using RP2040, the flagship microcontroller chip designed by Raspberry Pi in the UK From light displays and IoT devices to signage and manufacturing processes, the Raspberry Pi Pico series gives you the power to control countless home, hobby, and industrial operations.

# data[].attributes.attachment_link.title
Raspberry Pi Pico W: high-resolution pinout and specs

# data[].attributes.attachment_link.description
Raspberry Pi Pico W: high-resolution pinout and specs

# data[].attributes.body
- 확장보드활용이라 코드만 참고 가능
https://make.e4ds.com/contest/board_view.asp?t=2&idx=653&ctidx=8

라즈베리파이 피코 w의 LED 웹서버 제어(feat.구글 파이어베이스)
https://pythonkorea.com/72

# data[].attributes.attachment_link.readable_text
import machine
import utime

led = machine.Pin("LED", machine.Pin.OUT)

while True:
    led.value(1)
    utime.sleep(5)
    led.value(0)
    utime.sleep(5)

# data[].attributes.attachment_link.readable_text
from network import WLAN, STA_IF
from time import sleep

SSID = 'Smartclass'
PASSWORD = 'root1234!'

wlan = WLAN(STA_IF)
wlan.active(True)
wlan.connect(SSID, PASSWORD)

max_wait = 10
while max_wait > 0:
    if wlan.status() < 0 or wlan.status() >= 3:
        break
    max_wait -= 1
    print('waiting for connection...')
    sleep(1)
    
if wlan.status() != 3:
    raise RuntimeError('network connection failed')
else: # wlan.status() == 3
    print('connected')
    status = wlan.ifconfig()
    print('ip = ' + status[0])

# data[].attributes.attachment_link.readable_text
from network import WLAN, STA_IF
from time import sleep
import socket
from machine import Pin
import uasyncio as asyncio

SSID = 'Smartclass'
PASSWORD = 'root1234!'

HTML = '''<!DOCTYPE html>
<html>
    <head>
        <title>Pico W</title>
    </head>
    <body>
        <h1>Pico W</h1>
        <p>%s</p>
    </body>
</html>
'''

led = Pin(28, Pin.OUT)
led.value(0)

#led_heartbeat = Pin(19, Pin.OUT)
#led_heartbeat.value(0)

wlan = WLAN(STA_IF)

async def serve_client(reader, writer):
    print('Client connected')
    request_line = await reader.readline()
    print('Request:', request_line)
    
    while await reader.readline() != b'\r\n':
        pass
    
    request = str(request_line)
    led_on = request.find('/led/on')
    led_off = request.find('/led/off')
        
    print('index of /led/on = ' + str(led_on))
    print('index of /led/off = ' + str(led_off))
    
    if led_on == 6:
        print('led on!')
        led.value(1)
        state = 'LED is ON!'
        
    if led_off == 6:
        print('led off!')
        led.value(0)
        state = 'LED is OFF!'
    
    response = HTML % state
    
    writer.write('HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n')
    writer.write(response)
    
    await writer.drain()
    await writer.wait_closed()
    print('Client disconnected')
    
async def main():
    print('Connecting to Network...')
    wlan.active(True)
    wlan.connect(SSID, PASSWORD)

    max_wait = 10
    while max_wait > 0:
        if wlan.status() < 0 or wlan.status() >= 3:
            break
        max_wait -= 1
        print('waiting for connection...')
        sleep(1)
        
    if wlan.status() != 3:
        raise RuntimeError('network connection failed')
    else: # wlan.status() == 3
        print('connected')
        status = wlan.ifconfig()
        print('ip = ' + status[0])
        
    print('Setting up webserver...')
    asyncio.create_task(asyncio.start_server(serve_client, '0.0.0.0', 80))
    
    while True:
     #   led_heartbeat.value(1)
        print('heartbeat')
        await asyncio.sleep(0.25)
     #   led_heartbeat.value(0)        
        await asyncio.sleep(5)
        
try:
    asyncio.run(main())
finally:
    asyncio.new_event_loop()