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
main.cpp@0:9e8a54e32f30, 2020-02-06 (annotated)
- Committer:
- EISR
- Date:
- Thu Feb 06 07:46:51 2020 +0000
- Revision:
- 0:9e8a54e32f30
- Child:
- 1:13af94a28e0d
V2 fonctionnel
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
EISR | 0:9e8a54e32f30 | 1 | #include "mbed.h" |
EISR | 0:9e8a54e32f30 | 2 | #include "math.h" |
EISR | 0:9e8a54e32f30 | 3 | #include "bluetoothV2bibli.h" |
EISR | 0:9e8a54e32f30 | 4 | |
EISR | 0:9e8a54e32f30 | 5 | DigitalOut myled(LED1); |
EISR | 0:9e8a54e32f30 | 6 | DigitalOut myled4(LED4); |
EISR | 0:9e8a54e32f30 | 7 | |
EISR | 0:9e8a54e32f30 | 8 | void data_on_blueth(void); //fonction d'interruption |
EISR | 0:9e8a54e32f30 | 9 | int main(void) |
EISR | 0:9e8a54e32f30 | 10 | { |
EISR | 0:9e8a54e32f30 | 11 | //Ticker timer; |
EISR | 0:9e8a54e32f30 | 12 | |
EISR | 0:9e8a54e32f30 | 13 | init_blueth(); |
EISR | 0:9e8a54e32f30 | 14 | myled=1; |
EISR | 0:9e8a54e32f30 | 15 | myled4=1; |
EISR | 0:9e8a54e32f30 | 16 | //timer.attach(&data_on_blueth,0.005); // creation de l'interruption |
EISR | 0:9e8a54e32f30 | 17 | while(1) { |
EISR | 0:9e8a54e32f30 | 18 | if(get_val_pc(30) == 1024)myled=!myled; |
EISR | 0:9e8a54e32f30 | 19 | } |
EISR | 0:9e8a54e32f30 | 20 | } |
EISR | 0:9e8a54e32f30 | 21 | |
EISR | 0:9e8a54e32f30 | 22 | void data_on_blueth(void) |
EISR | 0:9e8a54e32f30 | 23 | { |
EISR | 0:9e8a54e32f30 | 24 | static short i = 0; |
EISR | 0:9e8a54e32f30 | 25 | short reg[4]={30,45,60,75}; |
EISR | 0:9e8a54e32f30 | 26 | formatTrameT(reg[i], 500000 ); //A chaque IT |
EISR | 0:9e8a54e32f30 | 27 | i++; |
EISR | 0:9e8a54e32f30 | 28 | if(i>3)i=0; |
EISR | 0:9e8a54e32f30 | 29 | } |