George Cochrane
/
ScoreCount2
Peter's version
Fork of ScoreCount by
Revision 0:c82f950266fc, committed 2013-05-01
- Comitter:
- gcme93
- Date:
- Wed May 01 13:50:51 2013 +0000
- Child:
- 1:d41b5b18175b
- Commit message:
- Hey bro!
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TSI.lib Wed May 01 13:50:51 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/emilmont/code/TSI/#507b1f67804b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TextLCD.lib Wed May 01 13:50:51 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/simon/code/TextLCD/#44f34c09bd37
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed May 01 13:50:51 2013 +0000 @@ -0,0 +1,62 @@ +#include "mbed.h" +#include "TSISensor.h" +#include "TextLCD.h" + + + +int hit=0; +int lives=20; +float a; +TSISensor tsi; + +DigitalOut Flash(PTC11); + + +TextLCD lcd(PTD7, PTD6, PTA17, PTA16, PTC17, PTC16); // rs, e, d4-d7 + + + +int main() + +{ + +lcd.cls(); + + while(1) + { + + while (lives>-1) + + { + a=tsi.readPercentage(); + + if (a>=0.01) + {hit=1;} + else + {hit=0;} + + + lcd.locate(0,0); + lcd.printf("Lives remaining: %d \n", lives); + + + if (hit==1) + { + + lives--; + + + + } + + } + +lcd.cls(); +lcd.locate(0,0); +lcd.printf(" - GAME OVER - ...you suck"); + +wait(20); +lcd.cls(); +lives=20; +} +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed May 01 13:50:51 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/7e6c9f46b3bd \ No newline at end of file