View webserver.py
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' |
View mastodon_followers.py
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') |
View picow_ntp_client.py
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" |
View ap_webserver.py
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) |
View async_webserver.py
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) |
View tensorflow_example.py
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/python3 | |
import tflite_runtime.interpreter as tflite | |
import sys | |
import os | |
import argparse | |
import cv2 | |
import numpy as np |
View widget.js
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
var WIDGETPOS={tl:32,tr:g.getWidth()-32,bl:32,br:g.getWidth()-32}; | |
var WIDGETS={}; | |
function drawWidgets() { for (var w of WIDGETS) w.draw(); } | |
require("Storage").list().filter(a=>a[0]=='=').forEach(widget=>eval(require("Storage").read(widget))); | |
setTimeout(drawWidgets,100); |
View simpleclock.js
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
// drawWidgets() is added by bootloader.js when loading a clock app, but when you upload via the IDE it just | |
// resets the watch and skips out running bootloader.js completely. So add the relevant code from the bootloader. | |
var WIDGETPOS={tl:32,tr:g.getWidth()-32,bl:32,br:g.getWidth()-32}; | |
var WIDGETS={}; | |
function drawWidgets() { for (var w of WIDGETS) w.draw(); } | |
require("Storage").list().filter(a=>a[0]=='=').forEach( | |
widget=>eval(require("Storage").read(widget))); | |
setTimeout(drawWidgets,100); |
View creditCard.swift
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
let creditCardNumbers = [ | |
4964149475059987, | |
4898620401632387, | |
4393958570449195, | |
4751492711160905, | |
4437340772573099, | |
] | |
let valid = creditCardNumbers.filter | |
{ number in |
View analog.ino
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
#define Debug Serial | |
float average = 0.0; | |
float total = 0.0; | |
int count = 0; | |
void setup() { | |
analogReadResolution(12); | |
pinMode(A0, INPUT); | |
Debug.begin(9600); |
NewerOlder