first commit

This commit is contained in:
gaohz committed 2024-06-06 04:13:43 +00:00
commit b8768c3ff8
249 files changed
+38439

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
import sys
import time
import wiringpi
from wiringpi import GPIO
I2C_ADDR = 0x48
BASE = 64
A0 = BASE+0
wiringpi.wiringPiSetup()
wiringpi.pcf8591Setup(BASE, I2C_ADDR)
while True:
try:
value = wiringpi.analogRead(A0)
print("value: %d"%value)
time.sleep(2)
except KeyboardInterrupt:
print('\nExit')
sys.exit(0)