Curriculum
Course: Obstacle Avoidance Robot
Login

Curriculum

Obstacle Avoidance Robot

Introducction to Obstacle Avoidance Robot

0/1

Introduction to Raspberry pi pico

0/1

Software Installation

0/1

Blinking Multiple LED

0/1

Traffic Light project

0/1

Analogue to digital Module(ADC)-1

0/1

Analogue to Digital Module(ADC)-2

0/1

Christmas Light Project

0/1

Interfacing push button switch

0/1

How to Interfacing Ultrasonic sensor

0/1

How to Interface both Ultrasonic sensor and Servo Motor.

0/1

Automated Barrier System

0/1

Interfacing geared DC Motor

0/1

Controlling geared DC Motor using Python program.

0/1

Speed Control of geared DC Motor

0/1

Coupling of Robotic Car chassis 1

0/1

Coupling of Robotic Car Chassis 2

0/1

Coupling of Robotic Car Chassis 3

0/1

Forward and Backward Robotic Car Movement

0/1

Ultrasonic Sensor Interfacing to Robotic Car

0/1

Addition of Servo Motor with Robotic Car

0/1

Completion of Robotic Car

0/1
Video lesson

Blinking an Onboard LED using Microblocks

Blinking an onboard LED using the Raspberry Pi Pico is a simple way to get started with programming the board. You can achieve this using either MicroPython or C/C++ programming languages. Here, I’ll provide examples for both.

Using MicroPython:

  1. Connect your Raspberry Pi Pico to your computer via USB.

  2. Create a new file named blink.py and open it in a text editor.

  3. Copy and paste the following code into blink.py:

python

import machine
import time

led = machine.Pin(25, machine.Pin.OUT)

while True:
led.toggle()
time.sleep(1)

  1. Save the file.

  2. Copy blink.py to the Raspberry Pi Pico. You can do this by dragging and dropping the file into the Pico’s USB drive.

  3. The LED on pin 25 (GP25) should start blinking once the file is copied over.

Using C/C++:

  1. Set up your development environment for Raspberry Pi Pico programming. You’ll need the official SDK and a code editor (e.g., Visual Studio Code).

  2. Create a new C/C++ file named blink.c and open it in your code editor.

  3. Copy and paste the following code into blink.c:

c

#include <stdio.h>
#include "pico/stdlib.h"
#include "hardware/gpio.h"

#define LED_PIN 25

int main() {
stdio_init_all();

gpio_init(LED_PIN);
gpio_set_dir(LED_PIN, GPIO_OUT);

while (true) {
gpio_put(LED_PIN, 1);
sleep_ms(1000);
gpio_put(LED_PIN, 0);
sleep_ms(1000);
}

return 0;
}

  1. Save the file.

  2. Build the code using the provided build system for the Raspberry Pi Pico SDK.

  3. Flash the compiled binary onto your Raspberry Pi Pico.

  4. The LED on pin 25 (GP25) should start blinking after flashing the binary onto the Pico.

These examples demonstrate how to blink the onboard LED of the Raspberry Pi Pico using both MicroPython and C/C++.