This file contains hidden or 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
""" | |
NOTE: requires the usual secrets.py file | |
The test | |
- connects to the server | |
- sends headers to switch to websockets mode | |
- reads the headers that the server sends back | |
Note: the code doesn't do anything else with the connection, | |
it will hang or disconnect, but it should receive the headers first. |
This file contains hidden or 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 time | |
from digitalio import DigitalInOut,Pull | |
led = DigitalInOut(board.LED) | |
led.switch_to_output() | |
safe = DigitalInOut(board.GP14) # <----- choose your pin with a button on it | |
safe.switch_to_input(Pull.UP) |
This file contains hidden or 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 time | |
import board | |
print("I2C") | |
i2c = board.I2C() | |
while not i2c.try_lock(): | |
i2c.unlock() | |
#i2c.unlock() | |
try: | |
scan = i2c.scan() |
This file contains hidden or 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 time | |
import board | |
DISPLAY_ADDRESS1 = 0x72 | |
i2c = board.I2C() | |
# from sparkfun_serlcd import Sparkfun_SerLCD_I2C | |
# lcd = Sparkfun_SerLCD_I2C(i2c,DISPLAY_ADDRESS1) | |
import openlcd_mini |
This file contains hidden or 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
# The MIT License (MIT) | |
# | |
# Copyright (c) 2017 Dan Halbert | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
This file contains hidden or 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
AtoQ = { | |
"0" : ")", | |
"1" : "!", | |
"2" : "@", | |
"3" : "#", | |
"4" : "$", | |
"5" : "%", | |
"6" : "^", | |
"7" : "&", | |
"8" : "*", |
This file contains hidden or 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 time | |
from analogio import AnalogIn | |
from digitalio import DigitalInOut,Pull | |
from simpleio import map_range | |
from neopixel import NeoPixel | |
# LED to blink | |
led = DigitalInOut(board.LED) | |
led.switch_to_output() |
This file contains hidden or 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
# https://github.com/adafruit/circuitpython-build-tools/ | |
echo "don't run this script, it's more a list of commands to copy and paste as you need them" | |
exit 1 | |
# installing the repositories, run only once | |
gh repo clone adafruit/Adafruit_CircuitPython_Bundle | |
cd Adafruit_CircuitPython_Bundle | |
git submodule init |
This file contains hidden or 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 | |
from analogio import AnalogIn | |
from digitalio import DigitalInOut,Pull | |
from simpleio import map_range | |
import tasko | |
# LED to blink | |
led = DigitalInOut(board.LED) | |
led.switch_to_output() |
This file contains hidden or 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 json | |
liste = set() | |
def print_once(text): | |
global liste | |
if text not in liste: | |
liste.add(text) | |
print(text) | |
def compare_files(oldfile_name,newfile_name): |