testing git
authorJordi <jordiguerrero@gmail.com>
Thu, 4 Feb 2016 15:32:24 +0000 (16:32 +0100)
committerJordi <jordiguerrero@gmail.com>
Thu, 4 Feb 2016 15:32:24 +0000 (16:32 +0100)
Fresonbot.py

index 896acf3..e4e9fad 100644 (file)
@@ -1,7 +1,6 @@
 import Adafruit_BBIO.PWM as PWM
 import Adafruit_BBIO.GPIO as GPIO
-import Adafruit_BBIO.ADC as ADC
-import time
+#import Adafruit_BBIO.ADC as ADC #IR
 import subprocess
 import math
 
@@ -10,12 +9,6 @@ import pinout
 
 class Fresonbot(object):
 
-    # State PWM -- (LEFT, RIGHT)
-    pwm = [0, 0]
-
-    # Constraints
-    pwmLimits = [-100, 100]  # [min, max]
-
     ticksPerTurn = 12 *100 # 12 counts per revolution * 100:1 reduction gearbox
     WheelRadius = 16 # In mm
     WheelDistance = 89 # In mm
@@ -36,10 +29,6 @@ class Fresonbot(object):
         PWM.start(pinout.PinMotorLeftPwm,0)
         PWM.start(pinout.PinMotorRightPwm,0)
 
-        PWM.start(pinout.servo_IR, self.duty_span * 0.5, 60.0)
-        duty = ((90.0 / 180) * self.duty_span + self.duty_min)
-        PWM.set_duty_cycle(pinout.servo_IR, duty)
-
         self.x = 0.0
         self.y = 0.0
         self.distance = 0.0
@@ -47,7 +36,7 @@ class Fresonbot(object):
         (TicksLeft, TicksRight) = self.getTicks();
         self.StartTicksLeft = TicksLeft 
         self.StartTicksRight = TicksRight 
-        ADC.setup()
+#        ADC.setup() # IR
 
     def motion(self,VelLeft,VelRight):
         AbsVelLeft = abs(VelLeft)
@@ -119,17 +108,12 @@ class Fresonbot(object):
 
     def stop(self):
         self.motion(0,0);
+
         return
-    def readIR(self):
-        voltage = ADC.read(pinout.PinIRFront)
-#        return value1 * 1.8
-        return 3.07427335017539*voltage**-1.18207892010248
-
-    def markDetection(self):
-        value1 = ADC.read(pinout.PinIRRightB)
-        return value1 * 1.8
-
-    def moveServo(self, angle):
-        duty = ((angle / 180.0) * self.duty_span + self.duty_min)
-        PWM.set_duty_cycle(pinout.servo_IR, duty)
-        return
+
+#    def readIR(self):
+#        voltage = ADC.read(pinout.PinIRFront)
+##        return value1 * 1.8
+#        return 3.07427335017539*voltage**-1.18207892010248
+
+