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
Fork of Test_Megre by
Getswitch2Send.cpp@1:426fbd0d126a, 2015-12-09 (annotated)
- Committer:
- Suchakhree
- Date:
- Wed Dec 09 10:19:11 2015 +0000
- Revision:
- 1:426fbd0d126a
- Parent:
- 0:238df339023b
????????????????? ????????
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Suchakhree | 1:426fbd0d126a | 1 | /* |
| Suchakhree | 1:426fbd0d126a | 2 | //Setup |
| Suchakhree | 1:426fbd0d126a | 3 | InterruptIn switch1(D11); |
| Suchakhree | 1:426fbd0d126a | 4 | InterruptIn switch2(D10); |
| Suchakhree | 1:426fbd0d126a | 5 | InterruptIn switch3(D7); |
| Suchakhree | 1:426fbd0d126a | 6 | void switch1(); |
| Suchakhree | 1:426fbd0d126a | 7 | void switch2(); |
| Suchakhree | 1:426fbd0d126a | 8 | void switch3(); |
| Suchakhree | 1:426fbd0d126a | 9 | int matrix_state=0; |
| Suchakhree | 0:238df339023b | 10 | |
| Suchakhree | 1:426fbd0d126a | 11 | |
| Suchakhree | 1:426fbd0d126a | 12 | // int main() |
| Suchakhree | 1:426fbd0d126a | 13 | switch1.rise(&switch_1); |
| Suchakhree | 1:426fbd0d126a | 14 | switch2.rise(&switch_2); |
| Suchakhree | 1:426fbd0d126a | 15 | switch3.rise(&switch_3); |
| Suchakhree | 1:426fbd0d126a | 16 | if(matrix_state == 0){mobile.printf("#MED$"); pc.printf("#MED$");} |
| Suchakhree | 1:426fbd0d126a | 17 | else if(matrix_state == 1){mobile.printf("#TR$"); pc.printf("#TR$\n");} |
| Suchakhree | 1:426fbd0d126a | 18 | else if(matrix_state == 2){mobile.printf("#TL$"); pc.printf("#TL$\n");} |
| Suchakhree | 1:426fbd0d126a | 19 | else if(matrix_state == 3){mobile.printf("#BR$"); pc.printf("#BR$\n");} |
| Suchakhree | 1:426fbd0d126a | 20 | if(switch1 == 0 && switch2 == 0 & switch3 == 0 ) matrix_state = 0; |
| Suchakhree | 1:426fbd0d126a | 21 | |
| Suchakhree | 1:426fbd0d126a | 22 | //Function |
| Suchakhree | 1:426fbd0d126a | 23 | void switch_1() |
| Suchakhree | 1:426fbd0d126a | 24 | { |
| Suchakhree | 1:426fbd0d126a | 25 | matrix_state=1; |
| Suchakhree | 1:426fbd0d126a | 26 | } |
| Suchakhree | 1:426fbd0d126a | 27 | void switch_2() |
| Suchakhree | 1:426fbd0d126a | 28 | { |
| Suchakhree | 1:426fbd0d126a | 29 | matrix_state=2; |
| Suchakhree | 1:426fbd0d126a | 30 | } |
| Suchakhree | 1:426fbd0d126a | 31 | void switch_3() |
| Suchakhree | 1:426fbd0d126a | 32 | { |
| Suchakhree | 1:426fbd0d126a | 33 | matrix_state=3; |
| Suchakhree | 1:426fbd0d126a | 34 | }*/ |
| Suchakhree | 1:426fbd0d126a | 35 |
