background image

 

VMA203 

V. 02 – 16/01/2019 

©Velleman nv 

 if (adc_key_in < 195)  return btnUP;  
 if (adc_key_in < 380)  return btnDOWN;  
 if (adc_key_in < 555)  return btnLEFT;  
 if (adc_key_in < 790)  return btnSELECT;    
*/ 
 
 
 return btnNONE;  // when all others fail, return this... 

 
void setup() 

 lcd.begin(16, 2);              // start the library 
 lcd.setCursor(0,0); 
 lcd.print("Velleman VMA203"); // print a simple message 

  
void loop() 

 lcd.setCursor(9,1);            // move cursor to second line "1" and 9 spaces over 
 lcd.print(millis()/1000);      // display seconds elapsed since power-up 
 
 
 lcd.setCursor(0,1);            // move to the begining of the second line 
 lcd_key = read_LCD_buttons();  // read the buttons 
 
 switch (lcd_key)               // depending on which button was pushed, we perform an action 
 { 
   case btnRIGHT: 
     { 
     lcd.print("RIGHT "); 
     break; 
     } 
   case btnLEFT: 
     { 
 // if You need the word "LEFT " shown on the display than use lcd.print("LEFT  ") instead of      
lcd.print(adc_key_in) and lcd.print(" v"); 
 // the following 2 lines will print the actual threshold voltage present at analog input 0 ; As these buttons 
are part of a voltage divider, pressing each button creates a different threshold voltage  
     
     lcd.print(adc_key_in); // shows the actual threshold voltage at analog input 0 
     lcd.print(" v"); // ends with v(olt)  
     break; 
     } 
   case btnUP: 
     { 
     lcd.print("UP    "); 
     break; 
     } 
   case btnDOWN: 
     { 
     lcd.print("DOWN  "); 
     break; 
     } 

Summary of Contents for VMA203

Page 1: ...VMA203 LCD KEYPAD SHIELD FOR ARDUINO LCD1602 USER MANUAL ...

Page 2: ...aning and user maintenance shall not be made by children without supervision Indoor use only Keep away from rain moisture splashing and dripping liquids 3 General Guidelines Refer to the Velleman Service and Quality Warranty on the last pages of this manual Familiarise yourself with the functions of the device before actually using it All modifications of the device are forbidden for safety reason...

Page 3: ...g something online You can tell your board what to do by sending a set of instructions to the microcontroller on the board To do so you use the Arduino programming language based on Wiring and the Arduino software IDE based on Processing Surf to www arduino cc and www arduino org for more information 5 Overview VMA203 The 16x2 LCD and keypad shield for Arduino Uno Mega Diecimila Duemilanove and Fr...

Page 4: ...ine btnDOWN 2 define btnLEFT 3 define btnSELECT 4 define btnNONE 5 read the buttons int read_LCD_buttons adc_key_in analogRead 0 read the value from the sensor my buttons when read are centered at these valies 0 144 329 504 741 we add approx 50 to those values and check to see if we are close if adc_key_in 1000 return btnNONE We make this the 1st option for speed reasons since it will be the most ...

Page 5: ...ve to the begining of the second line lcd_key read_LCD_buttons read the buttons switch lcd_key depending on which button was pushed we perform an action case btnRIGHT lcd print RIGHT break case btnLEFT if You need the word LEFT shown on the display than use lcd print LEFT instead of lcd print adc_key_in and lcd print v the following 2 lines will print the actual threshold voltage present at analog...

Page 6: ...s device For more info concerning this product and the latest version of this manual please visit our website www velleman eu The information in this manual is subject to change without prior notice COPYRIGHT NOTICE The copyright to this manual is owned by Velleman nv All worldwide rights reserved No part of this manual may be copied reproduced translated or reduced to any electronic medium or oth...

Page 7: ...n shocks falls dust dirt humidity and by the article as well as its contents e g data loss compensation for loss of profits consumable goods parts or accessories that are subject to an aging process during normal use such as batteries rechargeable non rechargeable built in or replaceable lamps rubber parts drive belts unlimited list flaws resulting from fire water damage lightning accident natural...

Reviews: