Gets user Input to turn the servo to certain degrees

Dependencies:   mbed

user.cpp

Committer:
hzelayasolano22
Date:
2019-01-14
Revision:
7:78973b67cd90
Parent:
3:5b6a55afc60a

File content as of revision 7:78973b67cd90:


#include "user.h"
Serial pc(USBTX, USBRX);

void userInit(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);
    }