#################################
baseMotorSpeed = 0
baseActuator = 0
armActuator = 0
clawPitch = 0
clawRoll = 0
clawOpenClose = 0

Motor1_baseMotor = motor_ibt2.motor1_ibt2(25, 24)
#IBT2 (2 pin)
Motor2_baseActuator = motor_l298n.motor1_L298n_NOPWM(6, 13)
#L298n (2 pin)
Motor3_armActuator = motor_l298n.motor1_L298n_NOPWM(19, 26)
#L298n (2 pin)

Motor4_clawPitch = motor_l298n.motor1_L298n(12, 1, 10)
#L298n (2 pin)

Motor5_clawRoll = motor_l298n.motor1_L298n(21, 20, 16)
#L298n (3 pin)
Motor6_clawOpenClose = motor_l298n.motor1_L298n_NOPWM(7, 8)
#L298n (2 pin)
#
#########################################################
#########################################################
groundIP = "192.168.185.58"


def IPCheckRoutine():
    print(time.ctime())
    response = os.system("ping -c 1 " + groundIP)
import motor_l298n

fowrard_left_motor = motor_l298n.motor1_L298n(
    2, 3, 4)  #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()
################################
# 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)
Motor2_baseActuator = motor_l298n.motor1_L298n_NOPWM(6,13);#L298n (2 pin)
Motor3_armActuator = motor_l298n.motor1_L298n_NOPWM(19,26); #L298n (2 pin)
Motor4_clawPitch = motor_l298n.motor1_L298n_NOPWM(12,1); #L298n (2 pin)
Motor5_clawRoll = motor_l298n.motor1_L298n(21,20,16);     #L298n (3 pin)
Motor6_clawOpenClose = motor_l298n.motor1_L298n_NOPWM(7,8);#L298n (2 pin)
#

######################################################################################################################
########## Function to Create a Socket ( socket connect two computers)
######################################################################################################################
def create_socket():
    try:
        #Creating following 3 global variables
        global host
        global port
        global s         #This is socket variable which is named s
        
        #Assigning values to these 3 global variables
        host = ""
Esempio n. 4
0
################################
# 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)
Motor2_baseActuator = motor_l298n.motor1_L298n_NOPWM(5,6);#L298n (2 pin)
Motor3_armActuator = motor_l298n.motor1_L298n_NOPWM(8,9); #L298n (2 pin)
Motor4_clawPitch = motor_l298n.motor1_L298n_NOPWM(11,12); #L298n (2 pin)
Motor5_clawRoll = motor_l298n.motor1_L298n(14,15,16);     #L298n (3 pin)
Motor6_clawOpenClose = motor_l298n.motor1_L298n_NOPWM(17,18);#L298n (2 pin)

#########################################################
#########################################################
groundIP = "192.168.185.58"
def IPCheckRoutine():
    print(time.ctime())
    response = os.system("ping -c 1 " + groundIP)
    if response == 0:
        print('BASE - CONNECTED');
    else:
        if(mode == 0):
            dataFromBase = "0,0,0"
            index1 = dataFromBase.index(',')
            propulsion(dataFromBase,index1);