libreria hc12
hc12.h@0:ac54225f5fcd, 2019-10-05 (annotated)
- Committer:
- guidoglorioso
- Date:
- Sat Oct 05 01:27:55 2019 +0000
- Revision:
- 0:ac54225f5fcd
programa trama proyecto
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
guidoglorioso | 0:ac54225f5fcd | 1 | #include "mbed.h" |
guidoglorioso | 0:ac54225f5fcd | 2 | |
guidoglorioso | 0:ac54225f5fcd | 3 | class hc12 |
guidoglorioso | 0:ac54225f5fcd | 4 | { |
guidoglorioso | 0:ac54225f5fcd | 5 | public: |
guidoglorioso | 0:ac54225f5fcd | 6 | hc12(); //se declaran los pines para usar |
guidoglorioso | 0:ac54225f5fcd | 7 | int get_speed_pedal(); |
guidoglorioso | 0:ac54225f5fcd | 8 | int get_changes(); |
guidoglorioso | 0:ac54225f5fcd | 9 | int get_break_pedal(); |
guidoglorioso | 0:ac54225f5fcd | 10 | |
guidoglorioso | 0:ac54225f5fcd | 11 | int get_steering_wheel(); |
guidoglorioso | 0:ac54225f5fcd | 12 | void update_parameters(char speed,char dist,char ejex,char ejey,char bateria); |
guidoglorioso | 0:ac54225f5fcd | 13 | private: |
guidoglorioso | 0:ac54225f5fcd | 14 | void llegan_datos(); |
guidoglorioso | 0:ac54225f5fcd | 15 | void maquina_datos(); |
guidoglorioso | 0:ac54225f5fcd | 16 | void noentrandatos(); |
guidoglorioso | 0:ac54225f5fcd | 17 | RawSerial MODULOHC(); |
guidoglorioso | 0:ac54225f5fcd | 18 | Checksum checksum; |
guidoglorioso | 0:ac54225f5fcd | 19 | Timeout NoLlegaNada; |
guidoglorioso | 0:ac54225f5fcd | 20 | enum {CASO_MOTORES,CASO_MANDODATOS,CASO_VOLPED,CASO_PALANCA}; //CASOS MAQUINA DE TODO EL PROGRAMA |
guidoglorioso | 0:ac54225f5fcd | 21 | enum {CASO_1,CASO_S,CASO_SA,CASO_D,CASO_DA,CASO_E,CASO_EA,CASO_EAA,CASO_B,CASO_BA,CASO_CHECK,CASO_FIN}; //CASOS MAQUINA DE LLEGADA DE DATOS |
guidoglorioso | 0:ac54225f5fcd | 22 | |
guidoglorioso | 0:ac54225f5fcd | 23 | char c,acelerador,freno,cambio,vector_datos[12],datos,check,vector_envio[12]; |
guidoglorioso | 0:ac54225f5fcd | 24 | unsigned char llegomal,llegobien,bat,speed,dist,ejex,ejey,tramamal; |
guidoglorioso | 0:ac54225f5fcd | 25 | bool newdata; |
guidoglorioso | 0:ac54225f5fcd | 26 | |
guidoglorioso | 0:ac54225f5fcd | 27 | |
guidoglorioso | 0:ac54225f5fcd | 28 | }; |