Great job makers, you ve now got the skills to use physical inputs with MicroPython (which will come in handy for the rest of the calendar) and can code if statements in all sorts of interesting new ways!
Today you have learnt:
How to create a circuit with physical inputs
How to code physical inputs with MicroPython
What if statements are and how to use them
How to use elif and else within if statements
How to use 'and and 'or' within if statement conditions
Well done makers! We know today was a little heavier as we introduced slightly more advanced topics such as analogue and PWM, so take the time to go back over today's examples and play with the code if you'd like more practice - make it, break it, fix it, learn!
Today you have:
Learnt about analogue and the difference between analogue and digital signals
Built a circuit with a potentiometer
Leant how to use the ADC built into the Raspberry Pi Pico
Controlled LEDs with an analogue signal
Learnt about PWM including duty cycle and frequency
We've covered lots today fellow makers, pat yourselves on the back!
As we cover more advanced topics such as functions, you may find that you need to refer back to these days to refresh your memory later on - and that's absolutely normal! Even the most seasoned professional programmers have to use search engines regularly (some even admit it!).
So what did we cover on day #5? Today you have:
Built a circuit with a buzzer, your first audio component
Learnt how to use the buzzer with MicroPython and the Pico
Learnt about PWM frequencies and duty cycle with buzzers
Used analogue inputs to control audio volume using PWM
Created a festive jingle with MicroPython
Learnt how to use functions to make your code easier to manage and more efficient
That last activity included a lot of detail so we're going to leave it there for today and not overload your fresh coder brains!
The PIR sensor can be so much fun to use and they come in all different shapes and sizes too, you'll be making your own home security system in no time.
So what did we cover on day #7? Today you have:
Built a circuit with a PIR sensor
Learnt how to use a PIR sensor with MicroPython and the Pico
Another day, another component completed! You now have a temperature sensor in your growing arsenal of parts to make projects with, and we're sure you'll use this one time and time again.
As you're probably starting to realise, a lot of these sensors and components are coded in a very similar way. Sometimes we need the help of imported libraries, sometimes we need resistors/additional hardware, but the fundamental way we write code for them (with loops, if statements and variables) is pretty consistent.
So what did we cover on day #8? Today you have:
Built a circuit with a temperature sensor
Learnt how to use a temperature sensor with MicroPython and the Pico
Used your first 1-wire component and the 1-wire library
Created a temperature monitor and temperature alarm system
Well done makers, we've cracked another sensor. Today's sensor (some might call it a switch) was a little easier than others, especially as you're now so familiar with MicroPython and the approaches we're taking, but we thought a little breather would be good before we adventure on to the fun yet slightly-more-advanced goodies in the final three boxes!
Today you have:
Learnt what a tilt sensor/switch is and why you might use one
Learnt how to wire a tilt sensor into your circuit (easy peasy!)
How to use variables and if statements in a way that improves the robustness and accuracy of our project
We hope you enjoyed the games in today's break beam activities - why not get the whole family involved to show off your project and see who can score the highest for ultimate bragging rights?
You now have another sensor in your ever-growing box of bits to make projects with - perhaps you'll combine it with the PIR sensor from day #7 to make an awesome alarm with multiple sensors?
This is the last time we'll be using the LEDs in the calendar, so go ahead and remove them from your circuit (it's best to keep them in the same bag as the resistors so that you don't mix them up). We also won't be using the buzzer tomorrow, so you can remove that as well.
So what did we cover on day 10? Today you have:
Built a circuit with break beam sensors
Learnt how to code break beams sensors (with their 'always HIGH' way of working)
Created a fun break beam game
Learnt additional time module options, including epoch time
Learnt how to use the sys module to end a program
Created nested if statements
Used simple maths to turn values into percentages with MicroPython
Continued to re-use all off the things you've learnt over the last 10 days
Aren't OLED displays just bags of fun? We've only just scratched the surface as well! There are lots of clever ways you can use these kinds of displays with graphics, fonts and other tricks, but we wanted to keep our activities relatively simple for beginners.
You'll find a ton of resources and other examples on the internet that you can use - we even have our own graphics tutorial which can apply to these displays too (with a few tweaks to the code).
Let's recap, what did we learn on day #11? Today we:
Learnt how to wire an OLED to our Raspberry Pi Pico
Introduced the I2C communication protocol
Leant how to install packages in Thonny
Learnt how to code an I2C OLED display, including:
How to write text to the display
How to write multiple lines of text
How to alter the position of text
How to display sensor data on OLED displays
A few little tricks like markers!
Re-used knowledge and components from previous boxes, such as:
This was a little longer than some of our other days as these LED strips are such a fun and versatile part to play with (and there's so much more you can do!).
We're pretty sure most of you will be turning your strip into a fancy monitor backlight - perhaps some will combine it with the PIR to turn it on when there's motion in front of their PC, or maybe some cleverly hidden break beam sensors will be used as a hand-activated colour changer? Whatever you make, we'd love to hear about your projects in the comments section!
So what did we cover on day #12? Today you have:
Learnt what an addressable LED is and why they're sooo fun!
Built a circuit with addressable LEDs
Learnt about RGB and how to create colours with RGB values (and where to find them)
Learnt how to code addressable LEDs with MicroPython
Learnt different ways to light the entire strip...some more efficient than others!
Created colour variables
Leant how to create and use lists in MicroPython, including list indexes
Used nested for loops
Leant how to use len in MicroPython
Faded addressable LEDs using range (both counting up and down)