Tell us about yourself!

Complete Your Profile
  • Build a DIY Desktop 3d Scanner with infinite resolution.

    I had the same issue (I have the same 1602 LCD from DFRobot), that is the code I used (no need to change threshold) : in DFR_key.CPP : "if (_curInput < 50) _curKey = RIGHT_KEY;else if (_curInput < 195) _curKey = UP_KEY;else if (_curInput < 380) _curKey = DOWN_KEY;else if (_curInput < 555) _curKey = LEFT_KEY;else if (_curInput < 790) _curKey = SELECT_KEY;else _curKey = NO_KEY;}"instead of : "if (_curInput > UPKEY_ARV - _threshold && _curInput < UPKEY_ARV + _threshold ) _curKey = UP_KEY; else if (_curInput > DOWNKEY_ARV - _threshold && _curInput < DOWNKEY_ARV + _threshold ) _curKey = DOWN_KEY; else if (_curInput > RIGHTKEY_ARV - _threshold && _curInput < RIGHTKEY_ARV + _threshold ) _curKey = RIGHT_KEY; ...

    see more »

    I had the same issue (I have the same 1602 LCD from DFRobot), that is the code I used (no need to change threshold) : in DFR_key.CPP : "if (_curInput < 50) _curKey = RIGHT_KEY;else if (_curInput < 195) _curKey = UP_KEY;else if (_curInput < 380) _curKey = DOWN_KEY;else if (_curInput < 555) _curKey = LEFT_KEY;else if (_curInput < 790) _curKey = SELECT_KEY;else _curKey = NO_KEY;}"instead of : "if (_curInput > UPKEY_ARV - _threshold && _curInput < UPKEY_ARV + _threshold ) _curKey = UP_KEY; else if (_curInput > DOWNKEY_ARV - _threshold && _curInput < DOWNKEY_ARV + _threshold ) _curKey = DOWN_KEY; else if (_curInput > RIGHTKEY_ARV - _threshold && _curInput < RIGHTKEY_ARV + _threshold ) _curKey = RIGHT_KEY; else if (_curInput > LEFTKEY_ARV - _threshold && _curInput < LEFTKEY_ARV + _threshold ) _curKey = LEFT_KEY; else if (_curInput > SELKEY_ARV - _threshold && _curInput < SELKEY_ARV + _threshold ) _curKey = SELECT_KEY; else _curKey = NO_KEY; }"

    View Instructable »
  • hadrien06 commented on 1232443's instructable Arduino LCD!3 years ago
    Arduino LCD!

    Please consider this version to add button Select : "//The code:#include <LiquidCrystal.h>LiquidCrystal lcd(8, 9, 4, 5, 6, 7);int readkey;void setup() { lcd.begin(16, 2); lcd.print("Fathers day");}void loop() { lcd.setCursor(0, 1); lcd.print("It doesn't?"); readkey=analogRead(0); if (readkey<50) { lcd.clear(); lcd.print("Button Right"); } else if(readkey<195) { lcd.clear(); lcd.print("Button Up"); } else if(readkey<380) { lcd.clear(); lcd.print("Button Down"); } else if(readkey<555) { lcd.clear(); lcd.print("Button Left"); } else if(readkey<790) { lcd.clear(); lcd.print("Button Select"); }}"

    View Instructable »