Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. char* options4[] = {"hMin1", "hMax1", "refr1", "fSpeed1"};
  2.  
  3. int option = 0;
  4. float variable = 82.0;
  5.  
  6. if(Serial.available() > 0) {
  7. key = Serial.read();
  8. if(key == back) {
  9. return;
  10. } else if(key == fwd) {
  11. float newVar = adjust(String(options4[option%4]), variable);
  12. } else if(key == down) {
  13. option++;
  14. } else if(key == up) {
  15. option--;
  16. }
  17. }
  18.  
  19. float adjust(char* str, float var) {
  20. ...do some stuff...
  21. display.print7Seg(str, 8);
  22. ...do stuff to var...
  23. return var;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement