I have looked all over the internet on how to run a brushless motor with an esc through RPi.GPIO and have no results. I have tried simply wiring the esc as it is supposed to be and programming it through PWM. Here is what I have so far:
joystick_count = pygame.joystick.get_count()
for i in range(joystick_count):
joystick = pygame.joystick.Joystick(i)
joystick.init()
axes = joystick.get_numaxes()
axes_list = []
for j in range(axes):
axis = joystick.get_axis(j)
axes_list.append(round(axis, 1))
M_out = (-axes_list[3] + 1) / 2
print(M_out * 100)
M_thrust.ChangeDutyCycle(M_out * 100)
Can anyone help me?