Extension to serial communication. GetInput() method that takes string input from serial device

Dependents:   PWM_LED_Lights

Committer:
nzupcic
Date:
Tue Sep 21 16:45:38 2021 +0000
Revision:
0:134dece3e39b
1st upload

Who changed what in which revision?

UserRevisionLine numberNew contents of line
nzupcic 0:134dece3e39b 1 #ifndef HOST_H
nzupcic 0:134dece3e39b 2 #define HOST_H
nzupcic 0:134dece3e39b 3
nzupcic 0:134dece3e39b 4 #include <string>
nzupcic 0:134dece3e39b 5 #include <cstdlib>
nzupcic 0:134dece3e39b 6 #include "mbed.h"
nzupcic 0:134dece3e39b 7
nzupcic 0:134dece3e39b 8 class Host : public Serial{
nzupcic 0:134dece3e39b 9 public:
nzupcic 0:134dece3e39b 10 Host(PinName tx, PinName rx);
nzupcic 0:134dece3e39b 11 void Init(float startValue);
nzupcic 0:134dece3e39b 12 string GetInput();
nzupcic 0:134dece3e39b 13 float Value;
nzupcic 0:134dece3e39b 14 bool Enable;
nzupcic 0:134dece3e39b 15 float LastState;
nzupcic 0:134dece3e39b 16 Timer timer;
nzupcic 0:134dece3e39b 17 };
nzupcic 0:134dece3e39b 18
nzupcic 0:134dece3e39b 19 #endif