You might want to use the software serial port for your LCD module to avoid conflicts with the hardware serial port that is also being used to upload your code. If the LCD module is connected while you are uploading your sketch it could be sent to never-never land.
The serial backpack is very temperamental, you have to upload the sketch without the TX pin connected. Then you have to unplug and replug the power with the TX pin connected. I believe you can only change the settings of the serial backpack during the initial boot that's why I have it in loop() and not setup(). I'm using the NewSoftSerial library to get around having to keep disconnecting and reconnecting the serial backpack. I'm using custom characters to create a volume bar graph, but at the default baud rate it moves extremely slow, so you can see it drawing everything from left to right.
I'm using custom characters to create a volume bar graph, but at the default baud rate it moves extremely slow, so you can see it drawing everything from left to right.
Probably NOT an effect of the baud rate. The baud rate defines how fast data is communicated between the Arduino and the serial backpack, not how fast that data is utilized by the serial backpack.
I never had that problem before I started using the serial backpack. In fact it's exactly the same code. I went with serial backpack because I needed to free up some pins.
Here is the volume bar graph function.
void changeVolume(int option, int number) {
clear(); // Clear LCD screen
cursorSet(1, 4);
lcd.print("V O L U M E");
cursorSet(2, 1);
lcd.print("[");
cursorSet(2, 17);
lcd.print("]");
for (int x = 1; x <= number; x++){
cursorSet(2, x + 1); // go left to right
lcd.print(3, BYTE); // show a block
}
for (int x = number; x <= 14; x++){
cursorSet(2, x + 2); // go left to right
lcd.print(5, BYTE); // show a underscore
}
int oldVol = number; // Current volume
if (option == 1) {
current_vol++; // Limit max volume to 0x000F
number++;
}
if (option == 2) {
current_vol--; // You can't go lower than zero
number--;
}
if (number > oldVol) { // check if the volume changed to a higher number
cursorSet(2, number + 1); // go left to right
lcd.print(3, BYTE); // show a block
}
if (number < oldVol) { // check if the volume changed to a smaller number
cursorSet(2, number + 2); // go right to left
lcd.print(5, BYTE); // show underscore
}
}
floresta:
You might want to use the software serial port for your LCD module to avoid conflicts with the hardware serial port that is also being used to upload your code. If the LCD module is connected while you are uploading your sketch it could be sent to never-never land.
Don
Been there before. I don't know why arduino will not even start when you power the dev board with serial LCD connected to hardware serial port, besides not loading sketches. It must have something to do with the ftdi chip. What Floresta meant was to only run baud rate change command once in setup instead of in loop and also have delays in loop when you want to print messages over and over.
If you want to try a different serial LCD, I just started selling mine Except mine has a keypad, buzzer, LED indicators, so you can call up the on-board menu and change any aspect manually beside using serial commands and it has 22K of code on it, the result of a whole summer's work. That must mean tons of features. PM me if you want a link. I don't want to sound too much like a spam
I believe you can only change the settings of the serial backpack during the initial boot that's why I have it in loop() and not setup().
That doesn't make any sense at all to me. The only difference between putting this code at the beginning of loop() instead of at the end of setup() is that it will be done over and over again.
I don't know why arduino will not even start when you power the dev board with serial LCD connected to hardware serial port, besides not loading sketches. It must have something to do with the ftdi chip.
Precisely. The FTDI chip converts the information coming from your computer from the serial USB protocol to a TTL version of the serial RS-232 protocol. This information is then fed into the same two microprocessor pins that your serial backback is connected to. There are a pair of 1K resistors that are supposed to isolate things but they apparently don't work too well. There's a lot to be said for the approach of Modern Device, Adafruit, and the others who use a separate board or cable for the USB interface.
I'll try to change the baud rate in setup() and see if that makes a difference, but I've had all types of problems when trying to change settings in setup(), especially with creating custom characters. I am really starting to think it's not possible, I seen tons of post where people asked the same question, but no one ever posted a solution or that they were able to change the baud rate.
JRMN:
I'll try to change the baud rate in setup() and see if that makes a difference, but I've had all types of problems when trying to change settings in setup(), especially with creating custom characters. I am really starting to think it's not possible, I seen tons of post where people asked the same question, but no one ever posted a solution or that they were able to change the baud rate.
What if you insert a delay(1000) in setup() before doing anything to the serial LCD? The serial LCD may need some time to boot up.
That's too bad. So when you said many had the same issue but found no answers, did you mean the comments on the sparkfun sales page or did you mean posts on sparkfun's forum? I thought their forum is alright. Maybe you can try there.
I did a Google search and I came across lot of people trying to change the baud rate on various forums. I came across a few threads on here and Sparkfun's forum as well. I've personally posted here, Sparkfun's forum and on their product page and I still haven't been able to change the baud rate.