hArduino-1.2: Control your Arduino board from Haskell.
Copyright(c) Levent Erkok
LicenseBSD3
Maintainererkokl@gmail.com
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

System.Hardware.Arduino.SamplePrograms.Counter

Description

Demonstrates using two push-buttons to count up and down.

Synopsis

Documentation

counter :: IO () Source #

Two push-button switches, controlling a counter value. We will increment the counter if the first one (bUp) is pressed, and decrement the value if the second one (bDown) is pressed. We also have a led connected to pin 13 (either use the internal or connect an external one), that we light up when the counter value is 0.

Wiring is very simple: Up-button connected to pin 4, Down-button connected to pin 2, and a led on pin 13.