Date: Exp. No.: Page No.: Aim:: Led Blinking Using Digitalout Function

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

LED BLINKING USING DIGITALOUT FUNCTION

Date:
Exp. No. : Page No. :

Aim:

 Give the introduction about Mbed Online Compiler and installation steps
 Write an mbed c code for the following task using DigitalOut function
 Task-1: On-board LED Blinking
 Task-2: LED blinking pattern one at a time
 Task-3: blinking alternate LEDs

General information:

The mbed NXP LPC11U24 Microcontroller in particular is designed for prototyping low cost
USB devices, battery powered applications and 32-bit ARM® Cortex™-M0 based designs. It
is packaged as a small DIP form-factor for prototyping with through-hole PCBs, stripboard
and breadboard, and includes a built-in USB FLASH programmer as shown in Fig. 1.

Fig. 1 : LPC11U24 Pin details


Specifications of LPC11U24:
 NXP LPC11U24 MCU
o Low power ARM® Cortex™-M0 Core
o 48MHz, 8KB RAM, 32KB FLASH
o USB Device, 2xSPI, I2C , UART, 6xADC, GPIO
 Prototyping form-factor
o 40-pin 0.1" pitch DIP package, 54x26mm
o 5V USB, 4.5-9V supply or 2.4-3.3V battery
o Built-in USB drag 'n' drop FLASH programmer
 mbed.org Developer Website
o Lightweight Online Compiler
o High level C/C++ SDK
o Cookbook of published libraries and projects

1
Task-1: On-board LED Blinking

API Used:

Syntax used for digital output:


DigitalOut (PinName pin)

For LED blinking we’ve used:


DigitalOut variable(LEDn); where n= 1,2,3,4

For delay:
wait(t) ; where ‘t’ is in seconds

Code for LED Blinking:


#include "mbed.h"
DigitalOut myled(LED1);
DigitalOut myled1(LED2);
DigitalOut myled2(LED3);
DigitalOut myled3(LED4);
int main() {
while(1) {
myled = 1;
wait(0.2);
myled2 = 1;
wait(0.2);
myled1=1;
wait(0.2);
myled3 = 1;
wait(0.2);
myled = 0;
wait(0.2);
myled2=0;
wait(0.2);
myled1=0;
wait(0.2);
myled3 = 0;
wait(0.2);
}
}
Output:
Paste all your output figure and have to give the description about the each and every
figures used in the output section. You have to paste all the supported figures for the
output.

2
Fig. 2 LED Blinking

Fig. 3 LED Blinking

Fig. 4 LED Blinking

Result: LED Blinking using mbed software was successfully executed and verified.

Scanned copy of the output verification with faculty signature.

You might also like