|Buy from USA||Buy from UK||Buy from DE||Buy from IT||Buy from FR||Buy from ES||Buy from JP|
In Pico Graphic programming tutorial lesson 1, we learned how to set up Pico to work with Google Chrome Browser and use PlayPiper.com Website to make a simple blink program. Users will know some basic programming blocks from Chip and Loops categories, including START, Repeat Forever, Turn Pin On/Off etc.
In this lesson, we will make a little bit more complicated program and use a push button to turn On/Off an external LED. We will learn a new programming block from the Logic category.
In above circuit graph, you can see that:
LED negative pin connected to GND
LED Positive pin connected to GP15 through 220 ohm resistor
Push button pin 1 connected to 3.3V
Push button pin 2 connected to GP14
After you assembly above circuit, we can start a new project in playpiper.com .
1)Click New Project icon, you will see a My project icon with a fancy name will pop up.
2)Click the new icon in My Projects
3)Now you will enter a new graphic programming page. Please click CONNECT Button in the bottom of the page and connect your Pico board to your project,Then your browser will pop up a Serial Port option menu, please select Pico from the menu and click Connect button;
If you can not see Pico in the Serial Port menu, it means your Pico is not setup properly. You need go back to Lesson 1 Step 1 and setup Pico again.
After you connect Pico to Serial Port, your GUI Connect button will switch to Disconnect button as following:
1)Click Chip -> Start , then move Start chip to coding area as following :
2)Click Loops -> repeat while true and move this block just below start block as following:
3)Click Logic -> if do else and move inside repeat while true block as following:
4)Click Chip -> is Pin condition block and move inside if do else block condition area, then change Pin 0 to Pin 14, change LOW when pulled UP to HIGH when pulled DOWN as following:
Explanation: this is “Pin 14 HIGH when pulled DOWN” block has two functionalities:
5)In Chip category, add two more turn pin blocks to GUI, and move them to do area and else area. Change pin number from 0 to 15, change else area ON status to OFF status, see following picture.
Now all we have finished building graphic program for this lesson, simply click Start button to run the program.
Now push the button in your bread board, the LED will turn on, when you release the button, the LED will turn off.
|1||Raspberry Pi Pico Board||https://osoyoo.store/products/raspberry-pi-pico-flexible-microcontroller-board-based-on-the-raspberry-pi-rp2040-dual-core-arm-cortex-m0-processor-1-pc?variant=39875307864175|
|3||Infrared Sensor Module||https://osoyoo.store/products/hc-sr501-pir-motion-sensor-for-arduino?variant=31957812838511|
|4||RFID Module and card||https://osoyoo.store/products/osoyoo-rfid-module?variant=31970646130799|
|5||Push Buttons and Hats||https://osoyoo.store/products/push-button-and-hats-5pcs?variant=39879253131375|
|6||LED(6 x White, 6 x Red, 6 x Yellow, 6x Green)||https://osoyoo.store/products/led-packs-for-arduino?variant=31957816442991|
|8||Piezo Buzzer Module||https://osoyoo.store/products/piezo-buzzer-module-1pcs?variant=39879251656815|
|9||I2C LCD Display(16×2)||https://osoyoo.store/products/i2c-lcd1602-display?variant=39875437101167|
|11||Solderless Prototype Breadboard||https://osoyoo.store/products/solderless-prototype-breadboard-1pcs?variant=39879255457903|
|12||Potentionmeter (10K adjustable resistor)||https://osoyoo.store/products/potentionmeter-10k-adjustable-resistor-3pcs?variant=39879281016943|
|13||40Pin M to M Jumper Wires||https://osoyoo.store/products/40pin-m-to-m-jumper-wires?variant=39879256539247|
|14||20Pin M to F Jumper wires 15cm||https://osoyoo.store/products/20pin-15cm-female-to-female-cable?variant=31930663305327|
DownLoad Url osoyoo.com