Hot answers tagged

14

That type of LCD has two main modes of operation: 4-bit mode which uses 4 data pins (d4-d7), and 8-bit mode which uses all 8 data pins (d0-d7). 4-bit mode has the advantage of requiring fewer output pins on your Arduino. However, it means your sketch needs to send each command/character as two separate batches of 4-bits (one after the other). This is ...


12

The row of white blocks is what you get before the screen's initialized. It's normal. The shadow behind the characters is because you have the contrast turned up too high. Adjust it down a little.


11

You have a huge switch...case here to decide the name of the file that should be played. This costs a lot of code space, but also data space, because every single literal string in this portion of code gets copied to RAM during initialization. There is no need to spend all this cost, as the file names have been assigned in a very regular fashion, so you can ...


10

There are actually several shields that have color screens on them. Many of the shields are just regular mini TFT displays, however there are also touch screen ones. Here is one from Adafruit that includes a MicroSD holder and a Joystick. Here is one from Radio Shack that features a 2.8 inch screen with touch capabilities As far as screen size, many of ...


8

Place a transistor in series with a 33R resistor between the LCD pin 16 (backlight ground) and GND and switch the transistor on and off with a digital pin. That way you'll be able to turn the backlight on and off. You can have a finer control over brightness if you put a PWM pulse on said pin. Just call analogWrite(D3, value) where value is the desired ...


7

Check out this tutorial on Adafruit. It will walk you through setting it up. In the tutorial they change the pins, which I believe is the issue here. Here is a snippet. And change your pins: LiquidCrystal lcd(7, 8, 9, 10, 11, 12);


7

Recently I also faced similar problem, with connection as: 1=GND, 2=+5v, 4=11, 6=12, 11=5, 12=4, 12=3, 14=2, 15=backlight positive, 16=backlight negative Solution: I just connected VEE (pin 3) of LCD to Ground (GND) without use of potentiometer as it worked.


7

I just happened to buy the same LCD Shields a few days ago, looking for a library to use it with a MEGA 2560 board I found https://github.com/Smoke-And-Wires/TFT-Shield-Example-Code which supports both UNO and MEGA boards. Usage is very, simple if we want to use it for MEGA we should change the header #include "uno_24_shield.h" in SWTFT.cpp to #include "...


7

This is likely a type of TTL LCD interface. But it is nearly impossible to describe more as there are so many variations both in hardware and in timing. Likely a steady stream of Red Green & Blue binary data way faster than an Arduino Uno could possibly manage is required to create an image. For the necessary processing power, you would have to utilize ...


7

Think of an Arduino as a circus clown spinning plates. It has to spend very little time on any one plate, and then it can keep a lot of plates spinning, moving quickly from one to the next. That's how "multi-tasking" works on a realtime device like an Arduino. You write a loop function that buzzes through a bunch of sub-tasks, spending a few ...


6

You don't need the MOSFET, you don't need the capacitor, you do need the resistor. The pins on your Arduino can deliver up to 20mA comfortably, so in this case there is no need for the MOSFET. However, if you were to replace your backlight with a high power LED, your current setup will work just fine. Without a capacitor, your PWM is a nice square wave. ...


6

If you look up the ASCII codes for what you sent vs what was displayed, and also look at "Table 4 Correspondence between Character Codes and Character Patterns (ROM Code: A00)" in an HD44780U spec sheet, you will find hexadecimal values like the following. e 65, V 56 l 6C, ニ C6 o 6F, θ F2 o 6F, π F7 r 72, & 26 d 64, B 24 and so forth. It appears ...


6

The lcd.print() method takes a string or a number as an argument, but not both at once. Using the + operator for concatenation is not native to C strings. C strings are basically stored as pointers to the first character of the string. So when you tried lcd.print("1234 " + number) and got "34 ", what most likely happened is that you advanced the pointer, ...


6

I have no idea if there is a chip or not, but I doubt it. But then, why do you need one? You already know how to communicate with the screen, so why not off-load those functions on to another Arduino (make your own small ATMega328P based board to do it) and then communicate with that through whatever means you like from your Leonardo? You don't need a ...


6

Your first code took a String object, then added other strings (note lowercase) to it - which are characters enclosed in quotes. It is legal to add strings to String objects. Your new code doesn't have any String objects at all - and you're not allowed to add strings to strings (both lowercase). It will work if you change your new code to: lcd.print(...


6

If you are using clasical UNO, then pins 0 and 1 are Serial. Declaring lcd(1,... make LCD use the pin 1 too, so Serial is confused and garbled. Use other pins for lcd and adjuct the wires acordingly.


6

The short answer to your question is “yes, there is a way”. Multiple ways actually. You could write a blocking function, which follows more or less the logic of the example you show, blocking while waiting for each new byte. Or you could write a non blocking function, which always return immediately and, either gives you the complete packet, or tells you ...


5

Instead of tying the backlight directly to V+ and GND, connect it to a PWM pin (you may need to use a separate driver if the pin cannot source/sink enough current). This will allow you to control the brightness via analogWrite(). Turn the LCD display off (LiquidCrystal::noDisplay()) when not actively in use. The contents will remain in memory but the LCD ...


5

There's also a 2.2" Adafruit TFT. The nice things about the Adafruit displays are: i) library support for both the display and the graphics core library. So it's easy to get it up and running. The built in frame buffer reduces resource requirements on Arduino.


5

Put the strings to display in an array, and output them instead. char const * const stateDisplay[] = {"Off", "On"}; ... lcd.print(stateDisplay[state]);


5

Thanks for the help everyone. I fixed it by using Capacitors. They suppress the noise that the dc motor produces. I found my information here


5

Some displays have different characters above 128. It is best to make your own character. That is what @dannyf ment with "CGRAM". The custom characters are stored in CGRAM. There is no need to read the datasheet though, because there is a function in the Arduino LiquidCrystal library for it. Start here: Arduino CreateChar reference There are even websites ...


5

instead of 9, it printed 90 No, it didn't: it printed “9”. However, it did not erase the previous value before printing “9”. Before printing the 9, the LCD had: ┌────────────────┐ │time left │ │10 │ └────────────────┘ ^cursor position When you printed “9”, that character replaced the “1”, and you end up seeing “90”. The fix, as pointed ...


4

A way to proceed is to create a spreadsheet showing the pin positions used by this board, and the Arduino shield signals they plug into. Next to these, you need columns showing the actual signals on the ATMega2560 (for Mega2560) and ATMega328 (for Uno) that these shield pins attach to. You can get this info from the Uno and Mega2560 schematic drawings. In a ...


4

This is a bad strategy in general. You should not be issuing print calls for things you don't want to print and relying on the lcd library to filter for you because they're out of bounds. Call print for only the choices you want to display. char* menu[] = { "choice 1", "choice 2", "choice 3", "choice 4", "choice 5", }; const int ...


4

No, it doesn't look like it. The LCD board uses digital pins 4-10 and analog 0 The motor board uses digital pins 3-12 if all motors are used. If you need to stack boards look for boards that use I2C since they can share a single data bus.


4

Insufficient decoupling. Put a 100nF cap on the supply lines at the LCD and a 100uF cap on the supply lines at the servo.


4

Im with @arvid-jense on this one, if you are working on a serious Digital Clock, then you should get the Real Time Clock. Now if you are learning Arduino and want to play with your LCD Minidisplay and build a clock, you must know some important limitations of the millis() function on this project: The mills function will overflow, after approximately 50 ...


4

With the I2C backpack there are three pairs of landings, A0, A1, A2, which determine the 3 LSB of the device's address, using inverted binary. Left alone, they generate part of the F or 7 part of the address. 0x3F is common, as is 0x27. To use more than one device it is necessary to jumper them all uniquely. The upper bits that generate the 0x3 are ...


Only top voted, non community-wiki answers of a minimum length are eligible