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.
Dependencies: mbed TSI USBDevice
Diff: main.cpp
- Revision:
- 1:b5afa5af13d5
- Parent:
- 0:4621dca43078
- Child:
- 2:4097fa431680
diff -r 4621dca43078 -r b5afa5af13d5 main.cpp
--- a/main.cpp Sun Apr 11 05:10:40 2021 +0000
+++ b/main.cpp Sun Apr 11 05:21:23 2021 +0000
@@ -14,7 +14,11 @@
}CommandList_e;
-DigitalIn button(PTB0);
+DigitalIn up(D4);
+DigitalIn down(D5);
+DigitalIn left(D6);
+DigitalIn right(D3);
+
//PwmOut rled(LED_RED);
//PwmOut gled(LED2);
@@ -48,13 +52,18 @@
int main(void)
{
// rled.period(0.001);
- TSISensor tsi;
- PwmOut rled(LED_RED);
+// TSISensor tsi;
+ up.mode(PullUp);
+ down.mode(PullUp);
+ left.mode(PullUp);
+ right.mode(PullUp);
while(1)
{
- rled = 1.0 - tsi.readPercentage();
+// rled = 1.0 - tsi.readPercentage();
wait(0.1);
+ if(!up)
+ keyboard.printf("Hello World\r\n");
// wait(1);
// keyboard.printf("Hello World\r\n");