Skip to content

Commit

Permalink
Update tv_remote.py to return -1 when no message
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyLindsay committed Apr 3, 2019
1 parent 2f26a78 commit 283d382
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Release/cyberbot-micropython/Examples/IR_Remote_Test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@

while True:
num = ir(2).remote()
if num < 1000:
if num > -1:
display.scroll( str(num), 75, wait=False )
sleep(100)
2 changes: 1 addition & 1 deletion Release/cyberbot-micropython/cyberbot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# microbit-module: cyberbot@0.7.0
# microbit-module: cyberbot@0.8.0
from microbit import *
while True:
try:i2c.read(93,1)
Expand Down
2 changes: 1 addition & 1 deletion Release/cyberbot-micropython/feedback360.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# microbit-module: feedback360@0.7.0
# microbit-module: feedback360@0.8.0
from cyberbot import *
class drive():
def __init__(self,p=0):
Expand Down
2 changes: 1 addition & 1 deletion Release/cyberbot-micropython/group_io.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# microbit-module: group_io@0.7.0
# microbit-module: group_io@0.8.0
from cyberbot import *
class io():
def __init__(self,p=0,q=33):
Expand Down
2 changes: 1 addition & 1 deletion Release/cyberbot-micropython/i2c_repeat.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# microbit-module: i2c_repeat@0.7.0
# microbit-module: i2c_repeat@0.8.0
from cyberbot import *
class i2c_repeat():
def __init__(self,p=33,q=33):
Expand Down
2 changes: 1 addition & 1 deletion Release/cyberbot-micropython/intbits.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# microbit-module: intbits@0.7.0
# microbit-module: intbits@0.8.0
class bit():
def get(v, i):
z = (v >> i) & 1
Expand Down
2 changes: 1 addition & 1 deletion Release/cyberbot-micropython/ping.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# microbit-module: ping@0.7.0
# microbit-module: ping@0.8.0
from cyberbot import *
class ping():
def __init__(self,p=33):
Expand Down
2 changes: 1 addition & 1 deletion Release/cyberbot-micropython/qti.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# microbit-module: qti@0.7.0
# microbit-module: qti@0.8.0
from cyberbot import *
class qti():
def __init__(self,p=0,q=33):
Expand Down
2 changes: 1 addition & 1 deletion Release/cyberbot-micropython/readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
This folder contains the MicroPython modules for the cyber:bot product.
This folder contains the MicroPython modules v0.8.0 for the cyber:bot product.

## Instructions for using MicroPython code from this folder with the cyber:bot
### Set up the Mu editor
Expand Down
2 changes: 1 addition & 1 deletion Release/cyberbot-micropython/shift.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# microbit-module: shift@0.7.0
# microbit-module: shift@0.8.0
from cyberbot import *
class shift():
def __init__(self,p=33,q=33):
Expand Down
7 changes: 5 additions & 2 deletions Release/cyberbot-micropython/tv_remote.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# microbit-module: tv_remote@0.7.0
# microbit-module: tv_remote@0.8.0
from cyberbot import *
class ir():
def __init__(self,p=0):
self.pin=p
def remote(self):
bot(self.pin).send_c(30)
return bot().read_r()
n=bot().read_r()
if n==0xFFFFFFFF:
n=-1
return n

0 comments on commit 283d382

Please sign in to comment.