Quantcast
Channel: MSP430 Technical Forums
Viewing all articles
Browse latest Browse all 2077

Problem with msp430, LCD16x2 and ADC

$
0
0
Greetings!
 
I'm using a potentiometer and lcd16x2 with msp430 this is my code:
 
#include <LiquidCrystal.h>
LiquidCrystal lcd(P1_4, P1_5, P1_0, P1_1, P1_2, P1_3);
 
int potPin = A7;//Potenciometer
int potValor = 0;
 
void setup() {
  lcd.begin(16, 2);//Using 16x2 LCD
  lcd.setCursor(0, 0); 
  lcd.print("ADC + LCD"); 
 
}
 
void loop() {
  potValor = analogRead(potPin); 
  lcd.setCursor(0, 1); 
  lcd.print(potValor); 
}
 
I just want to see on the LCD is what I read in the analog channel, but I get the following error:
 
 
problem+adc+and+lcd.png
 
but when I comment  potValor = analogRead(potPin);  or lcd.print(potValor);  the program compiles without errors
 
error.png
 
I have seen other examples in arduino and has no problems
 
Any ideas?
 
Thank you.
 

Viewing all articles
Browse latest Browse all 2077

Trending Articles