SOFT261 2018 May Coursework Power On Self Test application
Revision 4:3d7da70d57a1, committed 2018-05-01
- Comitter:
- noutram
- Date:
- Tue May 01 11:21:13 2018 +0000
- Parent:
- 3:6eb00bb6e76a
- Child:
- 5:b3323f02b914
- Commit message:
- Fixes
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue May 01 09:05:02 2018 +0000
+++ b/main.cpp Tue May 01 11:21:13 2018 +0000
@@ -69,14 +69,14 @@
//Check switches
puts("Press switches now");
wait(1.0);
- int s1 = __sw1;
- int s2 = __sw2;
+ int s1 = sw1;
+ int s2 = sw2;
printf("Switch 1 state = %s\n", (s1 == 1) ? "PRESSED" : "RELEASED");
printf("Switch 2 state = %s\n", (s2 == 1) ? "PRESSED" : "RELEASED");
puts("Release the switches");
wait(1.0);
- s1 = __sw1;
- s2 = __sw2;
+ s1 = sw1;
+ s2 = sw2;
printf("Switch 1 state = %s\n", (s1 == 1) ? "PRESSED" : "RELEASED");
printf("Switch 2 state = %s\n", (s2 == 1) ? "PRESSED" : "RELEASED");
@@ -84,32 +84,32 @@
puts("Checking LEDs");
for (unsigned int n=0; n<5; n++) {
puts("red");
- __redLed = 1;
- __yellowLed = 0;
- __greenLed = 0;
+ redLed = 1;
+ yellowLed = 0;
+ greenLed = 0;
wait(0.2);
puts("yellow");
- __redLed = 0;
- __yellowLed = 1;
- __greenLed = 0;
+ redLed = 0;
+ yellowLed = 1;
+ greenLed = 0;
wait(0.2);
puts("green");
- __redLed = 0;
- __yellowLed = 0;
- __greenLed = 1;
+ redLed = 0;
+ yellowLed = 0;
+ greenLed = 1;
wait(0.2);
}
//Check switches
- __greenLed = 0;
+ greenLed = 0;
//Finally the ADC
puts("Check ADC - turn potentiometer");
wait(1.0);
- float v = __adcIn;
+ float v = adcIn;
printf("vin = %.4f\n", v);
puts("Check ADC - turn potentiometer again");
wait(1.0);
- v = __adcIn;
+ v = adcIn;
printf("vin = %.4f\n", v);
puts("DONE.");
}