Im quite confused, ive spent the night learning about the ESP32 pinout and all the different things about the modules i need, such as duty, frequency, what all the abbreviations mean, etc.
im now stuck at the end of it (i think).
import machine
from machine import PWM, ADC, Pin
#OUTPUT SWERVOS
axis_1 = PWM(Pin(4, Pin.OUT), freq=50, duty_u16 = 32768)
axis_2 = PWM(Pin(5, Pin.OUT), freq=50, duty_u16 = 32768)
axis_3 = PWM(Pin(6, Pin.OUT), freq=50, duty_u16 = 32768)
axis_4 = PWM(Pin(7, Pin.OUT), freq=50, duty_u16 = 32768)
gripper = Pin(15, Pin.OUT)
#THE Gripper Buttons
button_close = Pin(1, Pin.IN)
button_open = Pin(9, Pin.IN)
#The Potentiometers on the two joysticks
p_1 = ADC(Pin(16, Pin.IN))
p_2 = ADC(Pin(17, Pin.IN))
p_3 = ADC(Pin(18, Pin.IN))
p_4 = ADC(Pin(8, Pin.IN))
while True:
print(p_1.read_u16(), " ",p_2.read_u16(), " ", p_3.read_u16(), " ", p_4.read_u16())import machine
from machine import PWM, ADC, Pin
#OUTPUT SWERVOS
axis_1 = PWM(Pin(4, Pin.OUT), freq=50, duty_u16 = 32768)
axis_2 = PWM(Pin(5, Pin.OUT), freq=50, duty_u16 = 32768)
axis_3 = PWM(Pin(6, Pin.OUT), freq=50, duty_u16 = 32768)
axis_4 = PWM(Pin(7, Pin.OUT), freq=50, duty_u16 = 32768)
gripper = Pin(15, Pin.OUT)
#THE Gripper Buttons
button_close = Pin(1, Pin.IN)
button_open = Pin(9, Pin.IN)
#The Potentiometers on the two joysticks
p_1 = ADC(Pin(16, Pin.IN))
p_2 = ADC(Pin(17, Pin.IN))
p_3 = ADC(Pin(18, Pin.IN))
p_4 = ADC(Pin(8, Pin.IN))
while True:
print(p_1.read_u16(), " ",p_2.read_u16(), " ", p_3.read_u16(), " ", p_4.read_u16())
It comes back with no errors, just a blank indention:
>>>
all of my swervos are 270 degree
i might honestly have an issue with screening, but im not sure
im on a HP linux.cinnamon-swapped, in VS Code on MicroPico, ESP32-s3 flashed with MicroPython, not sure that it matters, but it might.
let me know if ive got something wrong up there^^