Last active
August 29, 2015 13:56
-
-
Save hyperobject/8851071 to your computer and use it in GitHub Desktop.
Revisions
-
technoboy10 revised this gist
Feb 7, 2014 . 1 changed file with 7 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -35,19 +35,21 @@ def set_led(ledpos="right", onoff="on"): if onoff == "off": bot.setLED(ledpos,"off") menu('lineSensor', ['left', 'right']) @reporter("get %m.lineSensor line sensor value") def get_line(lineSensor='left'): positions = {'left': 0, 'right': 1} return bot.getLine(positions[lineSensor]) @reporter("get IR sensor %n value") def get_IR(n=1): return bot.getIR(n - 1) menu('lightSensor', ['left', 'center', 'right']) @reporter("get light sensor %m.lightSensor value") def get_light(lightSensor='center'): positions = {'left': 0, 'center': 1, 'right': 2} return bot.getLight(positions[lightSensor]) @reporter("get S2 name") def get_name(): -
technoboy10 revised this gist
Feb 7, 2014 . 1 changed file with 14 additions and 14 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,26 +12,26 @@ def stop_motors(): bot.stop() @command("set speed %n") def drive_straight(speed=100): bot.translate(speed / 100) @command("set speed left: %n right: %n") def drive_left_right(ls=100, rs=100): bot.motors(ls, rs) @command("play tone %n for %n seconds") def play_tone(tone=500, time=1): bot.beep(time, tone) @command("set S2 name to %s") def set_name(name): bot.setName(name) menu("ledPos", ["right", "left"]) menu("onOff", ["on", "off"]) @command("turn %m.ledPos led %m.onOff") def set_led(ledpos="right", onoff="on"): bot.setLED(ledpos, onoff) if onoff == "off": bot.setLED(ledpos,"off") @@ -43,19 +43,19 @@ def get_line(n=1): def get_IR(n=1): return bot.getIR(n - 1) menu('lightSensor', ['left', 'center', 'right']) @reporter("get light sensor %m.lightSensor value") def get_light(lightsensor='center'): positions = {'left': 0, 'center': 1, 'right': 2} return bot.getLight(positions[lightsensor]) @reporter("get S2 name") def get_name(): return bot.getName() @reset def reset_s2(): bot.stop() bot = Scribbler() blockext.run("Parallax S2 robot", "s2", 3610) -
technoboy10 revised this gist
Feb 7, 2014 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,9 +10,11 @@ @command("stop both motors") def stop_motors(): bot.stop() @command("set speed %n") def straight(speed=100): bot.translate(speed/100) @command("set speed left: %n right: %n") def turny(ls=100,rs=100): bot.motors(ls,rs) -
technoboy10 revised this gist
Feb 7, 2014 . 1 changed file with 8 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ @command("stop both motors") def stop_motors(): bot.stop() @command("set speed %n") def straight(speed=100): @@ -18,36 +18,36 @@ def turny(ls=100,rs=100): bot.motors(ls,rs) @command("play tone %n for %n seconds") def play_tone(tone=500,time=1): bot.beep(time,tone) @command("set S2 name to %s") def set_name(name): bot.setName(name) menu("ledpos",["right","left"]) menu("onoff",["on","off"]) @command("turn %m.ledpos LED %m.onoff") def set_led(ledpos="right", onoff="on"): bot.setLED(ledpos,onoff) if onoff == "off": bot.setLED(ledpos,"off") @reporter("get line sensor %n value") def get_line(n=1): return bot.getLine(n - 1) @reporter("get IR sensor %n value") def get_IR(n=1): return bot.getIR(n - 1) menu('lightsensor',['left','center','right']) @reporter("get light sensor %m.lightsensor value") def get_light(lightsensor='center'): return bot.getLight(positions[lightsensor]) @reporter("get S2 name") def get_name(): return bot.getName() @reset -
technoboy10 revised this gist
Feb 7, 2014 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -33,7 +33,6 @@ def setled(ledpos="right", onoff="on"): if onoff == "off": bot.setLED(ledpos,"off") @reporter("get line sensor %n value") def getline(n=1): return bot.getLine(n - 1) @@ -42,9 +41,10 @@ def getline(n=1): def getIR(n=1): return bot.getIR(n - 1) menu('lightsensor',['left','center','right']) @reporter("get light sensor %m.lightsensor value") def getlight(lightsensor='center'): return bot.getLight(positions[lightsensor]) @reporter("get S2 name") def getname(): -
technoboy10 revised this gist
Feb 7, 2014 . 1 changed file with 9 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,28 +16,36 @@ def straight(speed=100): @command("set speed left: %n right: %n") def turny(ls=100,rs=100): bot.motors(ls,rs) @command("play tone %n for %n seconds") def playtone(tone=500,time=1): bot.beep(time,tone) @command("set S2 name to %s") def nameset(name): bot.setName(name) menu("ledpos",["right","left"]) menu("onoff",["on","off"]) @command("turn %m.ledpos LED %m.onoff") def setled(ledpos="right", onoff="on"): bot.setLED(ledpos,onoff) if onoff == "off": bot.setLED(ledpos,"off") menu('linesensor',[' @reporter("get line sensor %n value") def getline(n=1): return bot.getLine(n - 1) @reporter("get IR sensor %n value") def getIR(n=1): return bot.getIR(n - 1) @reporter("get light sensor %n value") def getlight(n=1): return bot.getLight(n - 1) @reporter("get S2 name") def getname(): return bot.getName() @@ -46,5 +54,6 @@ def getname(): def resetall(): bot.stop() positions = {'left':0,'center':1,'right':2} bot = Scribbler() blockext.run("Parallax S2 robot", "s2", 3610) -
technoboy10 created this gist
Feb 6, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,50 @@ from __future__ import division from myro import * import blockext from blockext import * @command("stop both motors") def stopmotors(): bot.stop() @command("set speed %n") def straight(speed=100): bot.translate(speed/100) @command("set speed left: %n right: %n") def turny(ls=100,rs=100): bot.motors(ls,rs) @command("play tone %n for %n seconds") def playtone(tone=500,time=1): bot.beep(time,tone) @command("set S2 name to %s") def nameset(name): bot.setName(name) menu("ledpos",["right","left"]) menu("onoff",["on","off"]) @command("turn %m.ledpos LED %m.onoff") def setled(ledpos="right", onoff="on"): bot.setLED(ledpos,onoff) if onoff == "off": bot.setLED(ledpos,"off") @reporter("get line sensor %n value") def getline(n=1): return bot.getLine(n - 1) @reporter("get IR sensor %n value") def getIR(n=1): return bot.getIR(n - 1) @reporter("get light sensor %n value") def getlight(n=1): return bot.getLight(n - 1) @reporter("get S2 name") def getname(): return bot.getName() @reset def resetall(): bot.stop() bot = Scribbler() blockext.run("Parallax S2 robot", "s2", 3610)