# Thruster program python

**URL:** <https://discuss.bluerobotics.com/t/thruster-program-python/2402>\
**Category:** Thrusters and Motors\
**Created:** [March 30, 2018, 6:47pm UTC](https://discuss.bluerobotics.com/t/thruster-program-python/2402 "2018-03-30T18:47:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![karkotis](https://avatars.discourse-cdn.com/v4/letter/k/b4bc9f/32.png) [@karkotis](https://discuss.bluerobotics.com/u/karkotis)\
**Post date:** [March 30, 2018, 6:47pm UTC](https://discuss.bluerobotics.com/t/thruster-program-python/2402/1 "2018-03-30T18:47:11Z")

</div>

I am using a Raspberry Pi 2, Afro ESC’s, and t100 thrusters. I am a beginner. I am trying to connect the t100 thrusters to my raspberry pi 2. I had operated thruster with GPIO Pin. But i haven’t been working work. And connect with lumen light worked. What’s happening?

Thanks  
Christos

My program:  
from pygame import \*  
import RPi.GPIO as GPIO  
import time  
import pigpio

pi = pigpio.pi()  
init()  
screen = display.set\_mode((640, 480))  
display.set\_caption(‘the program’)

motor1=23  
motor2=24  
led1=22  
led2=25

endProgram = False

while not endProgram:  
for e in event.get():  
if e.type ==KEYDOWN:  
if (e.key == K\_a):  
print (“key a”)  
pi.set\_servo\_pulsewidth(motor1, 1200)  
pi.set\_servo\_pulsewidth(motor2, 1200)  
pi.set\_servo\_pulsewidth(led1, 1300)  
pi.set\_servo\_pulsewidth(led2, 1300)  
time.sleep(1)  
elif (e.key == K\_c):  
print(“key c”)  
pi.set\_servo\_pulsewidth(motor1, 1800)  
pi.set\_servo\_pulsewidth(motor2, 1850)  
pi.set\_servo\_pulsewidth(led1, 1700)  
pi.set\_servo\_pulsewidth(led2, 1700)  
time.sleep(1)  
elif (e.key == K\_b):  
print(“key b”)  
pi.set\_servo\_pulsewidth(motor1, 1700)  
pi.set\_servo\_pulsewidth(motor2, 1750)  
pi.set\_servo\_pulsewidth(led1, 1300)  
pi.set\_servo\_pulsewidth(led2, 1300)  
time.sleep(1)  
elif (e.key == K\_q):  
print(“key b”)  
pi.set\_servo\_pulsewidth(motor1, 0)  
pi.set\_servo\_pulsewidth(motor2, 0)  
pi.set\_servo\_pulsewidth(led1, 0)  
pi.set\_servo\_pulsewidth(led2, 0)  
time.sleep(1)  
elif e.key == K\_ESCAPE:  
endProgram = True  
else:  
print (“error”)

---

<div class="post-metadata">

**Author:** ![patrickelectric](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/patrickelectric/32/2162_2.png) [@patrickelectric](https://discuss.bluerobotics.com/u/patrickelectric)\
**Post date:** [March 30, 2018, 7:30pm UTC](https://discuss.bluerobotics.com/t/thruster-program-python/2402/2 "2018-03-30T19:30:51Z")

</div>

Hi Christos,

Are you using the same ground between the ESC and the raspberry ?
