Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

29 lines (26 sloc) 0.725 kb
#!/usr/bin/python
from mrbbio import *
def setup():
pinMode("P8.12", OUTPUT)
pinMode("P8.14", OUTPUT)
pinMode("P8.16", OUTPUT)
pinMode("P8.18", OUTPUT)
pinMode("P8.20", OUTPUT)
pinMode("P8.45", INPUT)
def loop():
if (digitalRead("P8.45") == HIGH):
print "Button Pressed at: %d" % millis()
digitalWrite("P8.12", HIGH)
digitalWrite("P8.14", HIGH)
digitalWrite("P8.16", HIGH)
digitalWrite("P8.18", HIGH)
digitalWrite("P8.20", HIGH)
delay(1000)
digitalWrite("P8.12", LOW)
digitalWrite("P8.14", LOW)
digitalWrite("P8.16", LOW)
digitalWrite("P8.18", LOW)
digitalWrite("P8.20", LOW)
print "analog reading:" + analogRead("P9.33")
delay(10) # don't peg the processor checking pin
run(setup, loop)
Jump to Line
Something went wrong with that request. Please try again.