Gets user Input to turn the servo to certain degrees
user.cpp@7:78973b67cd90, 2019-01-14 (annotated)
- Committer:
- hzelayasolano22
- Date:
- Mon Jan 14 00:35:57 2019 +0000
- Revision:
- 7:78973b67cd90
- Parent:
- 3:5b6a55afc60a
FINISHED and IT WORKS
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hzelayasolano22 | 1:f67847960b91 | 1 | |
hzelayasolano22 | 1:f67847960b91 | 2 | #include "user.h" |
hzelayasolano22 | 1:f67847960b91 | 3 | Serial pc(USBTX, USBRX); |
hzelayasolano22 | 1:f67847960b91 | 4 | |
hzelayasolano22 | 2:9d9717796ab2 | 5 | void userInit(void) { |
hzelayasolano22 | 1:f67847960b91 | 6 | pc.printf("\n\rType a number between 1 - 9 to move servo! \n\r"); |
hzelayasolano22 | 1:f67847960b91 | 7 | } |
hzelayasolano22 | 1:f67847960b91 | 8 | |
hzelayasolano22 | 1:f67847960b91 | 9 | char GetKeyInput(void) { |
hzelayasolano22 | 1:f67847960b91 | 10 | char c = pc.getc(); |
hzelayasolano22 | 1:f67847960b91 | 11 | pc.printf("%c",c); |
hzelayasolano22 | 1:f67847960b91 | 12 | return (c&0x0F); |
hzelayasolano22 | 1:f67847960b91 | 13 | } |