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.
Diff: main.cpp
- Revision:
- 0:9a1865214ee0
- Child:
- 1:158078765a61
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Wed Jan 07 16:41:41 2015 +0000
@@ -0,0 +1,25 @@
+#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);
+}