276°
Posted 20 hours ago

FRANZIS 55103 Raspberry Pi Advent Calendar, Build and Program a Nativity Scene in 24 Days, Includes 52 Page Manual, No Soldering

£9.9£99Clearance
ZTS2023's avatar
Shared by
ZTS2023
Joined in 2023
82
63

About this deal

We can decide how long we keep our LEDs ON/HIGH by changing the Duty Cycle. The duty cycle is the percentage of the time that our LED will be ON. The higher the duty cycle, the longer the LED will be ON, and the brighter our LED will appear.

Today we’ll be programming LEDs to light up, flash and display sequences, building on yesterday’s code using GPIO pins to control them. The while True loop then reads the potentiometer value and stores this in our readingvariable, and prints this for us to view in Thonny It doesn't matter which side of the LED the resistor sits , as long as it's there limiting the flow of current for the entire circuit ( take a look at the comment section for an example ). Raspberry Pi Pico Pin Map

Activity 3: Potentiometer Volume Control

Place a resistor between the left leg of each LED and the lower blue channel, like below. We'll be connecting that blue channel to a Ground (-) pin shortly.

The last activity created a game where we tried to hit the highest score possible in 30 seconds. This time we're creating a game with a target to hit within 30 seconds, using our LEDs to indicate how close the player is to beating the game.Please do not disassemble the circuit as we're going to be using it again with the contents in the next box...see you all tomorrow! We have included a 50/50 split between blinky components and control components (we alternate each day) The Duty Cycle sets the volumeof the buzzer. The range is technically 0 to 65535 in MicroPython, however we find that values below 5000 are very difficult for our ears to hear. A duty of 10000 appears to be the sweet spot for our buzzer.

Asda Great Deal

Free UK shipping. 15 day free returns.
Community Updates
*So you can easily identify outgoing links on our site, we've marked them with an "*" symbol. Links on our site are monetised, but this never affects which deals get posted. Find more info in our FAQs and About Us page.
New Comment