Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
- Committer:
- edumana
- Date:
- 2015-01-07
- Revision:
- 0:9a1865214ee0
- Child:
- 1:158078765a61
File content as of revision 0:9a1865214ee0:
#include "mbed.h"
Serial pc(USBTX, USBRX);
void pr(volatile uint32_t *reg);
int main(){
PORTA_PCR1 = 0x143; //Sets pin to GPIO
PORTA_PCR2 = 0x143; //Sets pin to GPIO
GPIOA_PDDR = 0x6; //Sets pin to output
GPIOA_PSOR = 0x2; //Turns RED off, Leaves GREEN on
while (1){
int volatile counter = 0;
while(counter < 10000000){
counter++;
}
GPIOA_PTOR = 0x6; //Toggles 0110, RED and GREEN LEDs
}
}
//Print Register: pr
void pr(volatile uint32_t *reg){
pc.printf("%x --> %x \n", reg, *reg);
}