Skip to content

Commit

Permalink
adjusted timings
Browse files Browse the repository at this point in the history
  • Loading branch information
mynameishamish committed Aug 26, 2018
1 parent f7e0ce1 commit e1765df
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,28 @@
m2temp_feed = aio.feeds('spyderbot.neck')
m3temp_feed = aio.feeds('spyderbot.head')

def temp():
while True:
# print("temp")
m1temp = robot.m1.present_temperature
m2temp = robot.m2.present_temperature
m3temp = robot.m3.present_temperature
if m1temp is not None and m2temp is not None:
print('m1Temp={0:0.1f}*C m2Temp={1:0.1f}*C m3Temp={2:0.1f}*C'.format(m1temp, m2temp, m3temp))
# Send humidity and temperature feeds to Adafruit IO
m1temp = '%.2f'%(m1temp)
m2temp = '%.2f'%(m2temp)
m3temp = '%.2f'%(m3temp)

aio.send(m1temp_feed.key, str(m1temp))
aio.send(m2temp_feed.key, str(m2temp))
aio.send(m3temp_feed.key, str(m3temp))
# else:
# print('Failed to get DHT22 Reading, trying again in ', DHT_READ_TIMEOUT, 'seconds')
# Timeout to avoid flooding Adafruit IO
time.sleep(timeout)



for m in robot.motors: # Note that we always provide an alias for all motors.
m.compliant = False
Expand Down

0 comments on commit e1765df

Please sign in to comment.