def run(): roboveroConfig() try: while True: data = [ analogRead(AD0_0), analogRead(AD0_1), analogRead(AD0_2), analogRead(AD0_3), analogRead(AD0_5), analogRead(AD0_6), analogRead(AD0_7) ] print data except KeyboardInterrupt: exit("\nkeyboard interrupt: how rude!")
def spin(self): while not rospy.is_shutdown(): self.time = rospy.Time.now() self.data.header.frame_id = "/imu_frame" self.data.header.seq = 1 self.data.header.stamp = self.time self.data.AD0_0 = analogRead(AD0_0) self.data.AD0_1 = analogRead(AD0_1) self.data.AD0_2 = analogRead(AD0_2) self.data.AD0_3 = analogRead(AD0_3) self.data.AD0_4 = analogRead(AD0_5) self.data.AD0_5 = analogRead(AD0_6) self.data.AD0_6 = analogRead(AD0_7) self.pub.publish(self.data) if self.rate: rospy.sleep(1/self.rate) else: rospy.sleep(0.1)
""" from robovero.arduino import analogRead, AD0_0, AD0_1, AD0_2, AD0_3, AD0_5, AD0_6, AD0_7 from robovero.extras import roboveroConfig from time import sleep __author__ = "Neil MacMunn" __email__ = "*****@*****.**" __copyright__ = "Copyright 2010, Gumstix Inc" __license__ = "BSD 2-Clause" __version__ = "0.1" roboveroConfig() try: while True: data = [ analogRead(AD0_0), analogRead(AD0_1), analogRead(AD0_2), analogRead(AD0_3), analogRead(AD0_5), analogRead(AD0_6), analogRead(AD0_7) ] print data except KeyboardInterrupt: exit("\nkeyboard interrupt: how rude!")
def read_left(self): return analogRead(self.left_pin)
def read_right(self): return analogRead(self.right_pin)
def read_measurement(self): """In inches""" return (analogRead(self.pin) * self.scale)
def read_raw(self): return analogRead(self.pin)
"""Acquire and display ADC readings using the Arduino API. """ from robovero.arduino import analogRead, AD0_0, AD0_1, AD0_2, AD0_3, AD0_5, AD0_6, AD0_7 from robovero.extras import roboveroConfig from time import sleep __author__ = "Neil MacMunn" __email__ = "*****@*****.**" __copyright__ = "Copyright 2010, Gumstix Inc" __license__ = "BSD 2-Clause" __version__ = "0.1" roboveroConfig() try: while True: data = [ analogRead(AD0_0), analogRead(AD0_1), analogRead(AD0_2), analogRead(AD0_3), analogRead(AD0_5), analogRead(AD0_6), analogRead(AD0_7) ] print data except KeyboardInterrupt: exit("\nkeyboard interrupt: how rude!")
"""Acquire and display ADC readings using the Arduino API. """ from robovero.arduino import analogRead, AD0_0 from robovero.extras import roboveroConfig from time import sleep __author__ = "Neil MacMunn" __email__ = "*****@*****.**" __copyright__ = "Copyright 2010, Gumstix Inc" __license__ = "BSD 2-Clause" __version__ = "0.1" roboveroConfig() try: while True: print analogRead(AD0_0) sleep(1) except KeyboardInterrupt: print "" print "keyboard interrupt: how rude!" exit()