0% found this document useful (0 votes)
155 views7 pages

1) LED Blinking

This document describes an experiment using an mbed board to blink LEDs. It provides details on the mbed board's microcontroller, features, and how to connect the board, write code using the online IDE, compile and upload code to blink single and multiple LEDs. Code samples are given to blink a single LED and then sequentially blink four LEDs in a loop. The aim was to understand the mbed architecture and write a basic LED blinking program.

Uploaded by

Senthil Athiban
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
155 views7 pages

1) LED Blinking

This document describes an experiment using an mbed board to blink LEDs. It provides details on the mbed board's microcontroller, features, and how to connect the board, write code using the online IDE, compile and upload code to blink single and multiple LEDs. Code samples are given to blink a single LED and then sequentially blink four LEDs in a loop. The aim was to understand the mbed architecture and write a basic LED blinking program.

Uploaded by

Senthil Athiban
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

LED Blinking

Exp. No. 1 SENTHIL ATHIBAN. M


13/07/2017 15BEC1067

AIM:-
To understand the instruction set and the architecture of the mbed
board. Also to write a basic program to blink the on board LED present in the
board.
Board view:-

Features offered:-
The micro-controller used in this board is a low power AMR cortex M0
core.
Its clock speed is 48 MHz, with 8 KB RAM and 32 KB flash.
It will be used as a USB Device with 2 SPIs, I2C, UART, 6 ADCs, and GPIO.
The micro-controller is a 40 pin IC.
It can operate on 5V USB, 4.5 5V power supply or 2.4 3.3V battery.
Getting started with mbed:-
Connect the mbed board to the PC, after sometime the mbed board
will be recognized as a USB device.
Open the device and click on the mbed.htm file.
It will take us to the mbed account where we must log in or sign up.
We need a live internet connection for writing a program in mbed
board.

Uploading a code:-
Write the code in C on the mbed online complier.
Save and compile the code for verifying that the code is error free.
Download the code as a .bin format.
Open the mbed board device and just paste the code inside.
Then press the reset button.
When we press the reset the status led will blink once indicating the new
code is burnt.
If the status led is not doing so then try pasting the file again.
LED 1-4:-
We can get the full schematics for the board from mbed website.
Procedure:-
Login to the online IDE and sign up for an account.
Add the board (LPC11U23) to the workspace.
Connect the board using the USB cable and check the connection.
Type the code in the editor and compile it.
Copy the .bin file and paste it into the file directory of the board.
Click the reset button and the code will now run on the board.

Code:-
a) Single LED blink:
#include "mbed.h"
DigitalOut myled1(LED1);
int main() {
while(1) {
myled1 = 1;
wait(0.2);
myled1 = 0;
wait(0.2);
}
}

Output:-

b) Multiple LED blink:


#include "mbed.h"
DigitalOut myled1(LED1);
DigitalOut myled2(LED2);
DigitalOut myled3(LED3);
DigitalOut myled4(LED4);
int main() {
while(1) {
myled1 = 1;
myled2 = 0;
myled3 = 0;
myled4 = 0;
wait(0.2);
myled1 = 0;
myled2 = 1;
myled3 = 0;
myled4 = 0;
wait(0.2);
myled1 = 0;
myled2 = 0;
myled3 = 1;
myled4 = 0;
wait(0.2);
myled1 = 0;
myled2 = 0;
myled3 = 0;
myled4 = 1;
wait(0.2);
}
}

Output:-
Result:-
Thus we have learnt how to use the mbed board and its online complier.
We also used its online complier to write a code to blink an onboard led.

You might also like