Skip to content

Commit

Permalink
dual_analog_bars.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ramalho committed Nov 29, 2014
1 parent 47b29b2 commit 36e9913
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pingo/examples/dual_analog_bars.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import pingo
import time

this = pingo.detect.MyBoard()
that = pingo.arduino.get_arduino()
galileo = pingo.detect.MyBoard()
arduino = pingo.arduino.get_arduino()

pot_this = this.pins['A0']
pot_this.mode = pingo.ANALOG
pot_galileo = galileo.pins['A0']
pot_galileo.mode = pingo.ANALOG

pot_that = that.pins['A0']
pot_that.mode = pingo.ANALOG
pot_arduino = arduino.pins['A0']
pot_arduino.mode = pingo.ANALOG


def bar(pin1, pin2):
bar1 = ('*' * int(pin1.ratio() * 40)).ljust(40)
bar2 = ('*' * int(pin2.ratio() * 40)).rjust(40)
print bar1 + bar2
print bar2 + bar1

while True:
bar(pot_this, pot_that)
bar(pot_galileo, pot_arduino)
time.sleep(0.05)

0 comments on commit 36e9913

Please sign in to comment.