Exemplo n.º 1
0
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!")
Exemplo n.º 2
0
	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)
Exemplo n.º 3
0
"""

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!")
  
Exemplo n.º 4
0
 def read_left(self):
     return analogRead(self.left_pin)
Exemplo n.º 5
0
 def read_right(self):
     return analogRead(self.right_pin)
Exemplo n.º 6
0
 def read_measurement(self):
     """In inches"""
     return (analogRead(self.pin) * self.scale)
Exemplo n.º 7
0
 def read_raw(self):
     return analogRead(self.pin)
Exemplo n.º 8
0
"""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!")
Exemplo n.º 9
-1
Arquivo: adc.py Projeto: lmasson/ADCS
"""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()