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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Tom's Hardware...on a Raspberry Pi Pico W</title> | |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/css/bootstrap.min.css" integrity="sha384-gH2yIJqKdNHPEq0n4Mqa/HGKIhSkIHeL5AyhkYV8i59U5AR6csBvApHHNl/vI1Bx" crossorigin="anonymous"> | |
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/js/bootstrap.min.js" integrity="sha384-ODmDIVzN+pFdexxHEHFBQH3/9/vQ9uori45z4JjnFsRydbmQbmL5t1tQ0culUzyK" crossorigin="anonymous"></script> | |
<style> |
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 vlc | |
import time | |
# creating vlc media player object | |
media_player = vlc.MediaPlayer() | |
# The video that we wish to play | |
media = vlc.Media("PiCast.mp4") | |
# Loading up the video ready for playback | |
media_player.set_media(media) |
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
#!/bin/bash | |
current_time=$(date "+%Y.%m.%d-%H.%M.%S") | |
echo "Current Time : $current_time" | |
scrot -d 60 "${current_time}.png" |
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
"""BME688 / BME680 demo | |
This demo will work for both the BME680 and BME688. | |
""" | |
import time | |
from breakout_bme68x import BreakoutBME68X, STATUS_HEATER_STABLE | |
from pimoroni_i2c import PimoroniI2C | |
import badger2040 | |
import machine | |
badger = badger2040.Badger2040() |
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
# This file is where you keep secret settings, passwords, and tokens! | |
# If you put them in the code you risk committing that info or sharing it | |
secrets = { | |
'ssid' : 'YOUR SSID', | |
'password' : 'YOUR PASSWORD', | |
'timezone' : 'YOUR LOCATION', # http://worldtimeapi.org/timezones | |
} |
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 board | |
import busio | |
from digitalio import DigitalInOut | |
import adafruit_requests as requests | |
import adafruit_esp32spi.adafruit_esp32spi_socket as socket | |
from adafruit_esp32spi import adafruit_esp32spi | |
from secrets import secrets | |
print("Raspberry Pi Pico WiFi Weather Station") | |
JSON_URL = "http://api.openweathermap.org/data/2.5/weather?q=LOCATION&appid=API KEY&units=metric" |
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
#! /usr/bin/env python3 | |
from pynput.keyboard import Key, Controller | |
from time import sleep | |
keyboard = Controller() | |
while True: | |
charge_state = int(open("/sys/class/power_supply/BAT0/capacity","r").readline().strip()) | |
if charge_state < 80: | |
keyboard.press("@") | |
keyboard.release("@") |
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 smbus | |
import time | |
bus = smbus.SMBus(1) | |
address = 0x48 | |
print("Please ensure that the joystick is centred, the test will start in...") | |
for i in range(3,0,-1): | |
print(i) | |
time.sleep(1) | |
print("The resting value for each axis is as follows...") |
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 smbus | |
import time | |
bus = smbus.SMBus(1) | |
address = 0x48 | |
while True: | |
y = bus.read_byte_data(address, 1) | |
x = bus.read_byte_data(address, 0) | |
print("Y = ",y,"X = ",x) | |
time.sleep(0.01) |
NewerOlder