01-21-2014 05:29 PM
I recently bought this serial LCD screen to use with my arduino. I've got the LCD working in Labview after editing the LabVIEWInterface.ino file to add a new switch-case command. I have some static text that will always be shown on the LCD, but I want 2 numeric fields to be passed by labview. Here's my switch-case to show you what I mean;
/*********************************************************************************
** SerialLCD
*********************************************************************************/
case 0x2E:
// Initialize LCD module
lcd.init();
// Set Contrast
lcd.setContrast(50);
// Set Backlight
lcd.setBacklightBrightness(8);
lcd.home();
lcd.print("Current Temp:");
lcd.print(command[2]);
lcd.setCursor(2,1);
lcd.print("Set Temp:");
lcd.print(command[3]);
break;
The attached "LCD.vi" works great. However, I want the LCD to be continuously updated, so I put in a while loop that loops every second. Suddenly, it doesn't work anymore. Well, the first iteration works, but if you change the values in labview while the program is running, the LCD does not update with new values. I'm not sure what's going on. I attached the "LCD_loop.vi" as well. Does anyone have any ideas?
01-21-2014 10:44 PM
I'm guessing it is because you are initializing the LCD every time that you call that function (so, the second time you send the command, it already exists). You will probably need to have at least three custom functions work with the LCD:
01-22-2014 06:16 AM
Nathan_B. wrote:
I'm guessing it is because you are initializing the LCD every time that you call that function
Doh! I knew I was missing something easy. I'm going to re-write the my switch-case tonight and add a couple new cases to handle the lcd.init(), lcd backlight and contrast settings, setCursor(), and finally lcd.print(). Then I can initialize the LCD and set backlight and contrast only once from Labview and not have it hard-coded. Thanks for your help! Sometimes you just need a second pair of eyes, especially after a 7 hour long coding marathon. ![]()
01-22-2014 11:19 AM
I know how those "coding marathons" can make things hide in plain sight easily
.