When I print the (result.value) value in hex format in serial print, I get the value of F23B45, but when I print it to nokia 5110, a mixed number appears. How can I solve it?
#include <IRremote.h>
#include <LCD5110_Basic.h>
LCD5110 myGLCD(8,9,10,11,12);
extern uint8_t SmallFont[];
IRsend irsend;
int RECV_PIN = 7;
IRrecv irrecv(RECV_PIN);
decode_results results;
long veri;
void setup()
{
myGLCD.InitLCD();
pinMode(buton, INPUT);
Serial.begin(9600);
irrecv.enableIRIn();
}
void loop() {
if (irrecv.decode(&results)) {
veri=results.value;
myGLCD.setFont(SmallFont);
myGLCD.print(veri, CENTER, 0);
Serial.println(results.value, HEX);
irrecv.resume();
}
}
J-M-L
October 4, 2022, 9:24am
2
don't you need to erase what's there before displaying something new? (I don't use that library)
data looks correct when written in hexadecimal format, but data looks incorrect without hexadecimal. clear screen don't need it
J-M-L
October 4, 2022, 10:19am
4
what does correct and incorrect means?
does the LCD5110_Basic library support printing in HEX?
There appears to be at least two libraries on GitHub with the header file named "LCD5110_Basic.h":
https://github.com/afiskon/arduino-nokia-lcd/tree/master/LCD5110_Basic
https://github.com/chapuzzo/ardusketches/tree/master/libraries/LCD5110_Basic
Neither of them inherit from the 'Print' class. So it seems unlikely they'd support the standard print in HEX syntax.
J-M-L
October 4, 2022, 11:09am
6
thanks for looking it up.
so now for OP to clarify what does correct and incorrect means...
Problem solved I used Adafruit gfx in library. It can be printed in Hex format.
system
Closed
April 2, 2023, 4:25pm
9
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.