30 Replies
why are you trying to read digital pins?
joystick
no no Look at your code pleaase
why are you trying to read digital pins?
oh sry
do you see one issue yet?
OH it was ther from the elegoo example
Ok so that is not correct.
Im guessing this is a mega clone board correct?
yes
mega
ok so read the first 5 lines of code there error is there.
ok
look closly and if you must write this down on paper some tims this helps you find the issue.
ok i am confuse i have no idea sory
do you see Xpin and Ypin?
yes
they are digital pins you can not nor ever read thenm as analog pins.
i mad it A0 and A1 but that did nothing
The issue is, NOW this brings your wireing into question.
so a wireing diagram is now in order.
ok
what do website do you sagest for the diagram
You can use wokwi, for a fast diagram and simulation. :d
also Im in voice chat if you want to join
na i am good i do not talk to people that i do know know but thanks for the option,ther is no dc moter on wokwi i think
ok here is one pretend the servos is cd motors

that looks correct.
are you using a motor driver?
not yet
'cuz pins won't power a DC motor
has for me befor
must be a very small motor, pins are rated for 20mA...
oh ok i will look in to one
i will test on smaler moters
then
not only current, you need to consider "back emf" when the motor stops it'll induce a large reverse voltage on the pin.
oh ok