示例#1
0
    def hat(self, value):
        #code here
        if value == (1, 0):
            send("forwardMini=1")

        elif value == (-1, 0):
            send("backMini=1")

        elif value == (0, 0):
            send("stopMini=1")

        elif value == (0, 1):
            send("openMiniArm=1")

        elif value == (0, -1):
            send("closeMiniArm=1")
示例#2
0
def calcSpeed(x, y):
    b = (y * cos(120) / sin(120) + x) / (cos(60) - cos(120) / sin(120)) * 170

    a = (-b * sin(60) + y) / sin(120) * 170

    a1 = a
    a2 = -a
    b1 = b
    b2 = -b
    send("a1=" + str(a1))
    send("a2=" + str(a2))
    send("b1=" + str(b1))
    send("b2=" + str(b2))
    print("a: " + str(a) + "     b: " + str(b))
示例#3
0
def cam(y):
    if y > 0:
        print(1)
        send("camUp=1")
    elif y == 0:
        print(0)
        send("camStale=1")
    else:
        print(-1)
        send("camDown=1")
示例#4
0
 def AnalogR(self):
     # code here
     send("LED=" + str(not self.led))
示例#5
0
 def but10(self):
     # code here
     send("connect=1", "connectJoy")
示例#6
0
 def Select(self):
     # code here
     send("stopAll=1")
示例#7
0
 def Rec(self):
     # code here
     send("armRotL=1")
示例#8
0
 def O(self):
     # code here
     send("armRotR=1")
示例#9
0
 def X(self):
     # code here
     send("armOpen=1")
示例#10
0
 def Tri(self):
     # code here
     send("armClose=1")
示例#11
0
 def but4(self):
     # code here
     send("ROVDown=1")
示例#12
0
 def L2(self):
     # code here
     send("ROVDown=1")
示例#13
0
 def L1(self):
     # code here
     send("ROVUp=1")
示例#14
0
 def R2(self):
     # code here
     send("speedDown=1")
示例#15
0
 def R1(self):
     # code here
     send("speedUp=1")