My attempt at using the mbed without the mbed libraries.

Dependencies:   ARM registers

Here is a main.cpp, that uses the registers library.

Committer:
elevatorguy
Date:
Fri Dec 21 01:55:10 2012 +0000
Revision:
0:5fa5046f2ff5
Child:
2:e26c096f1946
initial commit, I have DigitalOut, DigitalIn and wait() working

Who changed what in which revision?

UserRevisionLine numberNew contents of line
elevatorguy 0:5fa5046f2ff5 1 #include "registers.h" // oneliner: ain't that sexy!
elevatorguy 0:5fa5046f2ff5 2 DigitalOut led1(LED1);
elevatorguy 0:5fa5046f2ff5 3 DigitalOut led2(LED2);
elevatorguy 0:5fa5046f2ff5 4 DigitalIn switch1(p21);
elevatorguy 0:5fa5046f2ff5 5
elevatorguy 0:5fa5046f2ff5 6 int main() {
elevatorguy 0:5fa5046f2ff5 7 switch1.mode(PULLDOWN);
elevatorguy 0:5fa5046f2ff5 8 while(1) {
elevatorguy 0:5fa5046f2ff5 9 led1 = switch1;
elevatorguy 0:5fa5046f2ff5 10 led2 = !led1;
elevatorguy 0:5fa5046f2ff5 11 }
elevatorguy 0:5fa5046f2ff5 12 }