Raspberry Pi Pico W LESSON 56: Using a Joystick With MicroPython
HTML-код
- Опубликовано: 26 окт 2024
- You guys can help me out over at Patreon, and that will help me keep my gear updated, and help me keep this quality content coming:
/ paulmcwhorter
In this class we will be using the Sunfounder Raspberry Pi Pico W Keppler Kit. It will make things a lot easier if we are working on identical hardware. the link below is to amazon, and is for the identical hardware I will be using in this entire class.
amzn.to/3ubMRs1
In this video, I will show you how to control use a joystick with the Raspberry Pi Pico W using MicroPython. I will show you how to read X and Y values from the joystick, and then give you a homework assignment.
[Disclosure of Material Connection: I am a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to amazon.com. ]
#raspberrypipicow
#joystick
#micropython
I did the math and calibrated my joystick, completing the homework for this lesson. Thanks for this assignment.
Excellent!
This is a GREAT VIDEO! Thank YOU PAUL!
Thank you Paul!
Good stuff as usual.
Always very very interesting.
I totally enjoy all of your videos 😊
doing gods work
What ociliscope do you recommend at a reasonable price that is not a toy , but will work for a beginner? Would like to choose from a cheaper model to mid range price. Thanks
Good video
What is "u16()" in the program...
xVal=xJoy.read_u16()
Can it be u8() , u32() , u64() or u128() etc...
Please explain u16()...
I am not a programmer, but I know it stands for “unsigned int”, or unsigned integer. I guess unsigned means no negative numbers in that category of data. The 16 is the important part. It means 2 to the 16th power: 65536. Since computers always start at zero it is 0-65535. I hope that helps.
One more thing this also called “16 bit”. 8 but would be 0-255. Do the math. Lastly I think the 16 bit would be 2 byte and the 8 bit is one byte.
Here is the link to my homework for this lesson. Added a OLED display for the values. ruclips.net/video/EevHdrsOJ2k/видео.html
LEGEND!
Sorry the HW didn't load/show up here we go again. ruclips.net/video/G-WKmxLZ2j4/видео.htmlsi=agB9Dnc-Tr3aXdiW
This homework for joystick I found hard to find a solution, and ended up using Mapping function. here is my homework solution :- ruclips.net/video/7XojlUR13Lo/видео.html
Your video is set to private, so no one but you can see it. Also, watch my solution. Really hope you get comfortable doing the math on your own.
Have now set it to public, thank you Paul. @@paulmcwhorter
Got my homework done: ruclips.net/video/fR00qoRo57M/видео.html. Thanks for the great lesson Paul!
LEGEND!
Great content, once again, Paul! Math is our friend on this one. Here is my attempt at the homework assignment:
ruclips.net/video/3U_KmoNH03w/видео.html
Please excuse the coffee stain and orange peel juice stains on my calculation page:)
LEGEND!
"promo sm" 😅
Here is what I came up with for percentage on the joystick. The -100 moves the x,y axis to 0 center.
xVal=65535-xJoy.read_u16()
yVal=yJoy.read_u16()
xPer=int(xVal*100/32768-100)
yPer=int(yVal*100/32768-100)
print(xPer,yPer)
time.sleep(.25)
My HW for the pico Joystick. HW56PicoJoystick.mp4