This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Author: Alasdair Allan <[email protected]> | |
# SPDX-License-Identifier: MIT | |
# Simple RESTful web server for the Pimoroni WeatherHAT + Sensor Kit | |
# https://shop.pimoroni.com/products/weather-hat?variant=39672186765395 | |
# WeatherHAT Python Library | |
# https://github.com/pimoroni/weatherhat-python | |
# Calling GET endpoints, e.g. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from micropython import const | |
from ustruct import unpack as unp | |
# Author David Stenwall (david at stenwall.io) | |
# See https://github.com/dafvid/micropython-bmp280 | |
# SPDX-License-Identifier: MIT | |
# Power Modes | |
BMP280_POWER_SLEEP = const(0) | |
BMP280_POWER_FORCED = const(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Digital Watch Face | |
# | |
# Author: Tony Goodhew (28th January 2023) | |
# Updates: Toby Roberts, Andrew Scheller & Alasdair Allan (March 2023) | |
# | |
# Original code taken from https://www.instructables.com/Digital-Watch-Display-MicroPython/ | |
from machine import Pin,I2C,SPI,PWM | |
import framebuf | |
import time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
I2C_SDA -> 6 | |
I2C_SDA -> 7 | |
DC -> 8 | |
CS -> 9 | |
SCK -> 10 | |
DIN -> 11 | |
RST -> 12 | |
BL -> 25 | |
BAT_ADC -> 29 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
"Hello World!" | |
For https://www.tindie.com/products/adz1122/pi-pico-rp2040-128-inch-tft-display-watch-board/ | |
Using GC9A01 Display Driver for MicroPython (https://github.com/russhughes/gc9a01_mpy) | |
DISPLAY | |
======= | |
Pin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import network | |
import socket | |
import time | |
from machine import Pin | |
led = Pin("LED", Pin.OUT) | |
ssid = 'SSID' | |
password = 'PASSWORD' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import rp2 | |
import time | |
import network | |
import urequests as requests | |
# Connect to wireless network | |
SSID = 'NETWORK NAME' | |
PASSWORD = 'NETWORK PASSWORD' | |
rp2.country('GB') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import network | |
import socket | |
import time | |
import struct | |
from machine import Pin | |
NTP_DELTA = 2208988800 | |
host = "pool.ntp.org" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import network | |
import machine | |
ssid = 'MicroPython-AP' | |
password = '123456789' | |
led = machine.Pin("LED",machine.Pin.OUT) | |
ap = network.WLAN(network.AP_IF) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import network | |
import socket | |
import time | |
from machine import Pin | |
import uasyncio as asyncio | |
led = Pin(15, Pin.OUT) | |
onboard = Pin("LED", Pin.OUT, value=0) |
NewerOlder