Skip to content

Instantly share code, notes, and snippets.

@lostcaggy
Created January 7, 2010 22:39
Show Gist options
  • Save lostcaggy/271663 to your computer and use it in GitHub Desktop.
Save lostcaggy/271663 to your computer and use it in GitHub Desktop.
class Pushbutton < ArduinoSketch
# Page 42 of Getting started with Arduino, using a pushbutton to
#control an led
output_pin 13, :as => :led
input_pin 7, :as => :button_one, :device => :button
def loop
led.toggle if read_input button_one
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment