Hallo,
habe ein LCD 162C LED von reichelt.
Verwendeter Kontroller:
KS0066U
Habe das Beispiel Programm hier aus dem Forum schon aufgespielt und das funktioniert.
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
// set up the LCD’s number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("hello, world!");
}
void loop() {
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
// print the number of seconds since reset:
lcd.print(millis()/1000);
}
Nun wollte ich gerne eine Ausgabe in der void loop () programmieren.
Wenn ich dort eine Ausgabe vornehme, wird am Display nichts mehr angezeigt.
Kann das am Kontroller liegen, dass dies kein HD44780 ist?
Habe auch schon die library mal ausgetauscht.
Ändert nichts.
Anbei mein Code
#include <LiquidCrystal.h>
#include <VirtualWire.h> // you must download and install the VirtualWire.h to your hardware/libraries folder
#undef int
#undef abs
#undef double
#undef float
#undef round
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup()
{
lcd.begin(16, 2);
Serial.begin(9600);
// Initialise the IO and ISR
vw_set_ptt_inverted(true); // Required for RX Link Module
vw_setup(2000); // Bits per sec
vw_set_rx_pin(8); // We will be receiving on pin 4 i.e the RX pin from the module connects to this pin.
vw_rx_start(); // Start the receiver
}
void loop()
{
uint8_t buf[VW_MAX_MESSAGE_LEN];
uint8_t buflen = VW_MAX_MESSAGE_LEN;
// Daten-Variable, die die empfangenen Daten hält
char SensorDataTemp[VW_MAX_MESSAGE_LEN+1];
int temperature;
int humidity;
if (vw_get_message(buf, &buflen)) // check to see if anything has been received
{
int i;
// Message with a good checksum received.
memset(SensorDataTemp, 0, VW_MAX_MESSAGE_LEN+1); // Das ganze Array mit 0en füllen
for (i = 0; i < buflen; i++)
{
Serial.print((char)buf[i]); // the received data is stored in buffer
SensorDataTemp[i]=(char)buf[i];
}
}
// Char-Variable terminieren
SensorDataTemp[VW_MAX_MESSAGE_LEN+1] = '\0';
sscanf(SensorDataTemp, "s=%*d&t=%d&h=%d&v=%*d", &temperature, &humidity);
lcd.setCursor(2, 0);
lcd.print("Temp:");
lcd.setCursor(8, 0);
lcd.print(temperature/100);
lcd.setCursor(12, 0);
lcd.print("°C");
lcd.setCursor(0, 1);
lcd.print("Hum:");
lcd.setCursor(8, 1);
lcd.print(humidity/100);
lcd.setCursor(12, 1);
lcd.print("%");
delay(2000);
}