Add stack overflow working pycode!

This commit is contained in:
Kenwood 2021-07-05 02:37:18 +01:00
parent 209e15d41f
commit b5ba5f6f9e
1 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,20 @@
import smbus
import time
import struct
# for RPI version 1, use bus = smbus.SMBus(0)
bus = smbus.SMBus(1)
# This is the address we setup in the Arduino Program
address = 0x04
try:
for _x in range (0, 2):
for i in range(78, 130):
bus.write_i2c_block_data(address, 0, [1, i])
time.sleep(0.02)
for i in range(130, 78, -1):
bus.write_i2c_block_data(address, 0, [1, i])
time.sleep(0.02)
except OSError:
print("Could not speak to ardujmemo")