exchanging encoders
authorJordi <jordiguerrero@gmail.com>
Wed, 10 Feb 2016 19:38:24 +0000 (19:38 +0000)
committerJordi <jordiguerrero@gmail.com>
Wed, 10 Feb 2016 19:38:24 +0000 (19:38 +0000)
Fresonbot.py
Fresonbot.pyc
PID_test.py
bashScripts/test_encoders.sh
test_IR.py

index cdecd80..8a87946 100644 (file)
@@ -65,8 +65,8 @@ class Fresonbot(object):
         global TicksLeft
         global TicksRight
 
         global TicksLeft
         global TicksRight
 
-        fTicksLeft = "/sys/devices/ocp.3/48304000.epwmss/48304180.eqep/position"
-        fTicksRight = "/sys/devices/ocp.3/48302000.epwmss/48302180.eqep/position"
+        fTicksLeft = "/sys/devices/ocp.3/48302000.epwmss/48304280.eqep/position"
+        fTicksRight = "/sys/devices/ocp.3/48304000.epwmss/48304180.eqep/position"
         foTicksLeft = open(fTicksLeft, "r")
         foTicksRight = open(fTicksRight, "r")
 
         foTicksLeft = open(fTicksLeft, "r")
         foTicksRight = open(fTicksRight, "r")
 
index ae69c19..a8b089c 100644 (file)
Binary files a/Fresonbot.pyc and b/Fresonbot.pyc differ
index 7e83db9..bbe9614 100644 (file)
@@ -20,10 +20,8 @@ subprocess.call("bashScripts/enable_encoder_slots.sh")
 GPIO.setup(PinMotorLeftPhase, GPIO.OUT)
 GPIO.setup(PinMotorRightPhase, GPIO.OUT)
 
 GPIO.setup(PinMotorLeftPhase, GPIO.OUT)
 GPIO.setup(PinMotorRightPhase, GPIO.OUT)
 
-#fTicksLeft = "/sys/devices/ocp.3/48302000.epwmss/48302180.eqep/position"
-#fTicksRight = "/sys/devices/ocp.3/48304000.epwmss/48304180.eqep/position"
-fTicksLeft = "/sys/devices/ocp.3/48304000.epwmss/48304180.eqep/position"
-fTicksRight = "/sys/devices/ocp.3/48302000.epwmss/48302180.eqep/position"
+fTicksLeft = "/sys/devices/ocp.3/48302000.epwmss/48302180.eqep/position"
+fTicksRight = "/sys/devices/ocp.3/48304000.epwmss/48304180.eqep/position"
 
 TicksxRevolution = 1200
 WheelRadius = 16
 
 TicksxRevolution = 1200
 WheelRadius = 16
@@ -216,9 +214,9 @@ time.sleep(0.02)
 
 measureDistance();
 
 
 measureDistance();
 
-it = iter([400,0,400,400,0,400,200,200,0,0,400,0,400,400,0,400,200,200,0,0])
+#it = iter([400,0,400,400,0,400,200,200,0,0,400,0,400,400,0,400,200,200,0,0])
 #it = iter([200,0,200,200,0,200,0,0])
 #it = iter([200,0,200,200,0,200,0,0])
-#it = iter([200,0])
+it = iter([200,0])
 for xT, yT in zip(it, it):
     xTarget = xT
     yTarget = yT
 for xT, yT in zip(it, it):
     xTarget = xT
     yTarget = yT
index 9d55900..e38fbd3 100755 (executable)
@@ -4,8 +4,8 @@
 
 while :
 do
 
 while :
 do
-    echo -ne Left: $(cat /sys/devices/ocp.3/48304000.epwmss/48304180.eqep/position)
-    echo -ne " Right:" $(cat /sys/devices/ocp.3/48302000.epwmss/48302180.eqep/position)
+    echo -ne Left: $(cat /sys/devices/ocp.3/48302000.epwmss/48302180.eqep/position)
+    echo -ne " Right:" $(cat /sys/devices/ocp.3/48304000.epwmss/48304180.eqep/position)
     
     echo "  -- Press q to quit!"
 
     
     echo "  -- Press q to quit!"
 
index 815f63e..6f19270 100644 (file)
@@ -3,7 +3,12 @@ import Adafruit_BBIO.ADC as ADC
 import time
 
 ADC.setup()
 import time
 
 ADC.setup()
+
 while 1:
 while 1:
-    voltage = ADC.read("AIN1")
-    print(voltage)
+#    voltage1 = ADC.read("AIN1")
+    voltage4 = ADC.read_raw("AIN1")
+#    voltage4 = ADC.read_raw("AIN3")
+#    print("AIN1" ,voltage1)
+    print("AIN4", voltage4)
     time.sleep(0.05)
     time.sleep(0.05)
+