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.
Fork of EX25 by
Revision 1:ca389bf1cec5, committed 2017-02-03
- Comitter:
- chifterben94
- Date:
- Fri Feb 03 13:45:38 2017 +0000
- Parent:
- 0:c09709a8f2f0
- Commit message:
- AZDE
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Wed Feb 01 11:00:41 2017 +0000
+++ b/main.cpp Fri Feb 03 13:45:38 2017 +0000
@@ -7,18 +7,39 @@
AnalogIn Pot1 (A0);
C12832 ecran (D11,D13,D12,D7,D10);
Ticker ticker;
+Ticker ticker2;
char caractere = 0;
+char mot[100] = "Bonjour";
int etat = 1;
-
+int nbCarac = 0;
+int transmissionActive = 0;
+int nbEnvoi = 1;
void allumerEteindre()
{
green.write(etat);
}
+void envoyerBonjour()
+{
+ if(transmissionActive == 1 && nbEnvoi < 7*5 ){
+ pc.putc(mot[nbCarac]);
+ nbCarac ++;
+ nbEnvoi ++;
+ if(nbCarac == 7)
+ {
+ nbCarac = 0;
+ }
+
+ }
+
+}
+
int main() {
ticker.attach(&allumerEteindre,0.25);
+
+ pc.attach(&envoyerBonjour,pc.TxIrq);
while(1) {
@@ -37,7 +58,7 @@
break;
case 0x10 : //en haut
-
+ transmissionActive = 0;
if(pc.writeable())
{
@@ -48,8 +69,20 @@
}
break;
+
+ case 0x01 : // enfoncer
+
+ transmissionActive = 1;
+ pc.putc(' ');
+ nbEnvoi = 0;
+ etat = 1;
+ while (joy == 0x01){}
+
+ break;
+
}
+
wait(0.1);
}
