A simple multiplication calculator, on Raspberry Pi Pico W with Maker Pi Pico
With the Pico W attached on top of the Maker Board (see image for reference of maker Board), the Pico W will:
- Count the number of presses on
GP20
andGP21
respectively. - The counted number on
GP20
, stored as variableA
, will be displayed in 4-bit binary form. Ranging fromGP2
toGP5
, withGP2
being the MSB (most significant bit). - The counted number on
GP21
, stored as variableB
, will be displayed in 4-bit binary form. Ranging fromGP6
toGP9
, withGP6
being the MSB. - Pressing
GP22
will perform a multiplication onA
andB
. The value will be displayed in 6-bit binary form, ranging fromGP10
toGP15
, withGP15
being the MSB.- In the event that the result is unable to fit into 6 bits (overflow), all LEDs from
GP10
toGP15
will light up, andGP0
will become a 'breathing' light. (Basically, slowly dim up/down in brightness)
- In the event that the result is unable to fit into 6 bits (overflow), all LEDs from
- After
GP22
is pressed, system will wait for 5 seconds, then reset all led/button/variable value states.- During 5 second wait time, buttons are unresponsive.
NOTE_1:
GP0
uses PWM to drive the signal, whileGP2
toGP15
are signalled using standardGPIO
.
NOTE_2:GP20
andGP21
isn't expected to handle more than 16 presses. (aka, more tan 4-bits of presses)
NOTE: Install Pico C SDK if you haven't done so yet, with enviorment variable setup.
- In the
src
directory, make a new folder calledbuild
. - Open a terminal, access the
build
folder. - Run
cmake ..
- Run
build
A main.uf2
file should appear in the build
directory.
With the Raspberry Pi Pico W:
- Press and hold the button on the Pico W, then connect via USB to your PC.
- After a 3 seconds or so, let go of the button.
- you should see a new device media (Should be somthing like 'Pi2') appear on your respective file explorer program.
- Drop and drop the
main.uf2
into the new device media.
Enjoy ㊗️