For Loops & Lists | Raspberry Pi Pico Workshop: Chapter 3.4

🔗 The full course : core-electronics.com.au/cours...
For loops are one of the two types of loops we can use in MicroPython*, and are designed to be looped a set and *known amount of times, executing the code placed inside of them on every loop. In this video we will be learning how to use the loop function in conjunction with the range function to loop over a range of numbers, and lists to loop over a custom range of numbers or strings.
🔧🔨🧰 Hardware featured in this guide:
Raspberry Pi Pico:
core-electronics.com.au/catal...
The Pico Variants:
core-electronics.com.au/raspb...
💡❓ If you have any questions about this content or want to share a project you're working on head over to our maker forum: coreelec.io/forum
0:00 For vs While Loops
0:33 Looping a Set Number of Times
1:53 Looping Over a Range
2:45 Servo Sweep Example
4:55 Lists and Loops
6:45 3 Key Takeaways
🌏🦘 Core Electronics is located in the heart of Newcastle, Australia. We're powered by makers, for makers. Drop by if you are looking for:
• Raspberry Pi core-electronics.com.au/raspb...
• Arduino core-electronics.com.au/ardui...
• Sparkfun core-electronics.com.au/brand...
• Adafruit core-electronics.com.au/brand...
• Pololu core-electronics.com.au/brand...
• DFRobot core-electronics.com.au/brand...
The following trademarks are owned by Core Electronics Pty Ltd:
"Core Electronics" and the Core Electronics logo
"Makerverse" and the Makerverse logo
"PiicoDev" and the PiicoDev logo
"GlowBit" and the GlowBit logo

Пікірлер: 2

  • @malcolmbuck-wb3gc
    @malcolmbuck-wb3gc3 ай бұрын

    I have a question, how can I connect 12 servors with a header pins?

  • @Core-Electronics

    @Core-Electronics

    3 ай бұрын

    For that you are going to need to ensure that your power supply can provide enough current to power 12 servos. If each servo is 5v and draws 1 amp, you will need a 5v, 12 amp power supply. Once you have a power supply though, its just a matter of connecting 12 pwm pins from the pico to the servos, and plugging the servos into power. If you are looking for a nicer header-based solution, you can find servo drivers like this one that can be connected to the pico by I2C : core-electronics.com.au/piicodev-servo-driver.html