import motor_ibt2 import motor_l298n import os import connections import propulsion import roboticarm ###################ARDUINO SERIAL OBJECT################################################# #serialPortMac = '/dev/tty.usbmodem14101' #serialPortPi = '/dev/ttyACM0' #arduinoSerial = serial.Serial(serialPortMac, 9600, timeout = 1) #curently fL -> 2,3 mode = 0 motorspeed1 = 0 motorspeed2 = 0 forward_left_motor = motor_ibt2.motor1_ibt2(2, 3) forward_right_motor = motor_ibt2.motor1_ibt2(14, 15) backward_left_motor = motor_ibt2.motor1_ibt2(4, 17) backward_right_motor = motor_ibt2.motor1_ibt2(18, 23) ################################ # VARIABLES FOR ROBOTIC ARM: ################################# baseMotorSpeed = 0 baseActuator = 0 armActuator = 0 clawPitch = 0 clawRoll = 0 clawOpenClose = 0
#NanoSerial = serial.Serial(NanoSerialPortMac, 9600, timeout = 1) ################################# # VARIABLES FOR PROPULSION MOTOR: ################################# mode = 0 motorspeed1 = 0 motorspeed2 = 0 motorPWM1 = 0 motorPWM2 = 0 currYaw = 0 pastYaw = 0 turnValue = 0 forward_left_motor = motor_ibt2.motor1_ibt2(6, 13) forward_right_motor = motor_ibt2.motor1_ibt2(25, 8) backward_left_motor = motor_ibt2.motor1_ibt2(19, 26) backward_right_motor = motor_ibt2.motor1_ibt2(7, 1) latDestination = 12.843908 longDestination = 80.154008 latcurr = 0.00 longcurr = 0.00 distance = 0.00 ######################################################### ######################################################### groundIP = "192.168.43.45"
import motor_ibt2 fowrard_left_motor = motor_ibt2.motor1_ibt2( 2, 3) #Parameters are input LPWM_and RPWM pin of IBT2 fowrard_left_motor.moveMotor( -25 ) #Duticycle ranging from -100 to 100 [+ve means forward, -ve means backwards] #Testing by printing fowrard_left_motor.printMotor()
#importing socket so that we can connect two computer import socket #importing PySerial and time import serial import time import motor_ibt2 import motor_l298n ###################ARDUINO SERIAL OBJECT################################################# #serialPortMac = '/dev/tty.usbmodem14101' #serialPortPi = '/dev/ttyACM0' #arduinoSerial = serial.Serial(serialPortMac, 9600, timeout = 1) mode = 0; motorspeed1 = 0 motorspeed2 = 0 forward_left_motor = motor_ibt2.motor1_ibt2(2,3) forward_right_motor = motor_ibt2.motor1_ibt2(4,17) backward_left_motor = motor_ibt2.motor1_ibt2(15,14) backward_right_motor = motor_ibt2.motor1_ibt2(23,18) ################################ # VARIABLES FOR ROBOTIC ARM: ################################# baseMotorSpeed = 0 baseActuator = 0; armActuator = 0; clawPitch = 0; clawRoll = 0; clawOpenClose = 0; Motor1_baseMotor = motor_ibt2.motor1_ibt2(25,24); #IBT2 (2 pin)
import motor_ibt2 import motor_l298n import os ###################ARDUINO SERIAL OBJECT################################################# #serialPortMac = '/dev/tty.usbmodem14101' #serialPortPi = '/dev/ttyACM0' #arduinoSerial = serial.Serial(serialPortMac, 9600, timeout = 1) ################################ # VARIABLES FOR PROPULSION MOTOR: ################################# mode = 0; motorspeed1 = 0 motorspeed2 = 0 forward_left_motor = motor_ibt2.motor1_ibt2(6,13) forward_right_motor = motor_ibt2.motor1_ibt2(25,8) backward_left_motor = motor_ibt2.motor1_ibt2(19,26) backward_right_motor = motor_ibt2.motor1_ibt2(7,1) ################################ # VARIABLES FOR ROBOTIC ARM: ################################# baseMotorSpeed = 0 baseActuator = 0; armActuator = 0; clawPitch = 0; clawRoll = 0; clawOpenClose = 0; Motor1_baseMotor = motor_ibt2.motor1_ibt2(3,4); #IBT2 (2 pin)