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.
Diff: sousprog.h
- Revision:
- 0:dbd6ea244e7e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sousprog.h Thu May 19 13:06:08 2022 +0000
@@ -0,0 +1,59 @@
+
+// sous programmes de gestion technique de la carte micro
+
+void interrupt()// à chaque carractère reçut, ce programme est activé
+ { //
+ recpt = pc.getc();
+ if ( recpt == 'l') LED = 1 ; //allumer LED
+ if ( recpt == 'k') LED = 0 ; //eteindre LED
+
+ // augmenter ou baisser Vr ( compensation en température)
+ if ( recpt == 'r') {Vr = Vr - 0.02 ; if ( Vr < 0.05) Vr = 0.06;outVr.write(Vr) ; } //--
+ if ( recpt == 'm') {Vr = Vr - 0.001 ; if ( Vr < 0.05) Vr = 0.06;outVr.write(Vr) ; } // -
+ if ( recpt == 's') Vr = 0.3681 ; //vK remis à 20°C (environ )
+ if ( recpt == 'p') {Vr = Vr + 0.001 ; if ( Vr > 0.95) Vr = 0.94;outVr.write(Vr) ; } // +
+ if ( recpt == 'q') {Vr = Vr + 0.02 ; if ( Vr > 0.95) Vr = 0.94;outVr.write(Vr) ; } // ++
+ return; // fin du sous programme
+ }
+
+void init(void) // initialisations hard
+ {
+ pc.baud(115200); // vitesse liaison série
+ pc.attach(&interrupt, Serial::RxIrq); // autorise IT de liaison serie
+ plus = 1; // polarisation de la résistance de l'inter carte
+ LED = 0 ; // led carte off
+ outVr.write(Vr); // sortie de outVr sur la broche vK
+ //etape=0;
+ pc.putc('h') ; // dit au PC pas de carte capteur
+ pc.putc('d') ;
+ }
+
+ void calibrationT()
+ {
+ Vr = 0;
+ outVr.write(Vr);
+ Vs = 0;
+ while(Vs <= 0.57)
+ {
+ Vr = Vr + 0.001;
+ outVr.write(Vr);
+ wait(0.01);
+ Vs = inVs.read();
+ }
+ pc.putc('c');
+ }
+
+ void calibrationF()
+ {
+ Vr = 0.66;
+ outVr.write(Vr);
+
+ wait(0.01);
+ Vs = inVs.read();
+ pc.putc('c');
+ }
+
+ void calibrationL()
+ {
+ pc.putc('c');
+ }