title: Are there well-established design patterns on implementing a user prompt?
body: <p>I'm working on a embedded project which reads a joystick and moves an actuator within a 3d space accordingly. Now I would like to provide a user prompt available over serial line as an alternative option as user input. User input will be G-Code.</p>
  
  <p><a href="https://en.wikipedia.org/wiki/G-code" rel="nofollow">https://en.wikipedia.org/wiki/G-code</a>.</p>
  
  <p>I'm not unexperienced with creating C code, however, I never had to deal with text input before. Are there any well established design patterns on how software of this kind is implemented in a easy-to-read/maintanable way?</p>