Gets user Input to turn the servo to certain degrees
Diff: user.cpp
- Revision:
- 1:f67847960b91
- Parent:
- 0:1f19faa3ee1f
- Child:
- 2:9d9717796ab2
--- a/user.cpp Fri Jan 11 19:48:57 2019 +0000 +++ b/user.cpp Fri Jan 11 19:56:55 2019 +0000 @@ -0,0 +1,14 @@ + + +#include "user.h" +Serial pc(USBTX, USBRX); + +void HostInit(void) { + pc.printf("\n\rType a number between 1 - 9 to move servo! \n\r"); +} + +char GetKeyInput(void) { + char c = pc.getc(); + pc.printf("%c",c); + return (c&0x0F); + } \ No newline at end of file