DesignForAmputee hw 5 project

Dependencies:   mbed BLE_API nRF51822

Committer:
jstroud
Date:
Fri Nov 07 23:34:15 2014 +0000
Revision:
4:0ebd5e43da47
Parent:
3:436ef162bf2d
Child:
5:46dd21736d36
power + temp test for nordic

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jstroud 0:6a0d0bc31c4c 1 #include "mbed.h"
pgao 3:436ef162bf2d 2
jstroud 4:0ebd5e43da47 3 DigitalOut myled(LED1);
jstroud 4:0ebd5e43da47 4 DigitalOut power(P0_0); // brown
jstroud 4:0ebd5e43da47 5
jstroud 4:0ebd5e43da47 6 AnalogIn tempPin(P0_1); // purple
jstroud 4:0ebd5e43da47 7 float temp;
pgao 3:436ef162bf2d 8 Serial pc(USBTX, USBRX);
pgao 3:436ef162bf2d 9
pgao 3:436ef162bf2d 10
jstroud 4:0ebd5e43da47 11 int main() {
jstroud 4:0ebd5e43da47 12 while(1) {
jstroud 4:0ebd5e43da47 13 myled = 1;
jstroud 4:0ebd5e43da47 14 wait(0.2);
jstroud 4:0ebd5e43da47 15 myled = 0;
jstroud 4:0ebd5e43da47 16 wait(0.2);
jstroud 4:0ebd5e43da47 17 power = 1;
jstroud 4:0ebd5e43da47 18 temp = tempPin.read();
jstroud 4:0ebd5e43da47 19 pc.printf("%f\n",temp);
jstroud 0:6a0d0bc31c4c 20 }
jstroud 0:6a0d0bc31c4c 21 }