Skip to content

Instantly share code, notes, and snippets.

View danjperron's full-sized avatar

Daniel Perron danjperron

  • Québec, Canada
View GitHub Profile
@danjperron
danjperron / ads1015.py
Created December 1, 2022 00:14
ACS712_05 and ADS1015 for solar panel charge
from functools import wraps
from threading import Lock
import time
def synchronized(func):
@wraps(func)
def wrapper(self, *args, **kwargs):
with self._lock:
@danjperron
danjperron / gosundTest.py
Created May 11, 2023 00:03
python test using tinytuya with 3 plug gosund
import tinytuya
import time
# Connect to Device
# set dev_id and local of your devec
gosund = tinytuya.OutletDevice(
dev_id='eb8bla8a7blad387bla5xc',
address='10.11.12.133', # Or set to 'Auto' to auto-discover IP address
local_key='#]X[blablablaX~V^$eZ~RI`V',
version=3.3)
@danjperron
danjperron / picoFreq.py
Created August 1, 2023 12:19
pico PIO frequency reader
'''
*
*
* The MIT License (MIT)
*
* Copyright (c) 2023 Daniel Perron
*
* 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
@danjperron
danjperron / mfrc522.py
Last active January 17, 2024 01:39
MFRC522 TAG-N215 experimental
from machine import Pin, SPI
from os import uname
class MFRC522:
DEBUG = False
OK = 0
NOTAGERR = 1
ERR = 2