Show Posts
|
|
Pages: [1] 2 3 4
|
|
1
|
Using Arduino / Displays / Re: What type of LCD?
|
on: May 06, 2013, 02:41:24 pm
|
|
I used my first I2C interface this week so I'm not sure of what's available. What do you mean by "I want to buy just the 1602- compatible I2C modules to solder to the LCD's. "? MAS has pointed out that the 16 02 specifies the character array but what do you mean by "I2C modules"? Can you provide a link to the ones you're considering?
I'm not sure what MAS means by "you can do with 4 and most Arduino sketches do" unless this is a reference to something other than a parallel interface or he's not counting the EN and R/S signals. Maybe I've missed an important alternative but I've been using 6 pins for my interfaces. Like you, I needed some of those output pins that my 4 bit parallel LCD interface was using.
The approach I took was to get some PCF 8574 I/O expander chips. I paid $1.00 each from Newark although I'm sure you can find them cheaper. They provide a two wire interface and, by use of address selection pins, can be programmed to 8 different I2C addresses.
|
|
|
|
|
2
|
Using Arduino / Displays / Re: Parallax LCD Countdown Timer
|
on: May 06, 2013, 08:36:30 am
|
it displays the millis on the next line. which is not ideal. Where do you want it displayed? mySerial.write(148); //carraige return mySerial.print(now); //display current millis, otherwise the time starts at 1m6s?! Does this carriage return push millis (actually "now") to the next line? Is this what you consider to be not ideal? I wonder if there is a way to make it count down from 30 minutes instead though? To do this, can you figure out the starting time, add 30 minutes and then subtract the current time from the starting time? You'll have to change your "Boom" criterion.
|
|
|
|
|
4
|
Using Arduino / Displays / Re: LCD without variable resistor
|
on: May 03, 2013, 07:37:48 pm
|
|
I have experience with approx. 15 LCD displays of 4 or 5 different types. For some of the displays I've used, I've gotten legible results with just a 1K resistor from the contrast pin to ground. I have even had a couple of displays work with the contrast pin floating. On the two LCDs I've tried tonight, however, the text can not be distinguished from the background without the 1K resistor.
Using the variable resistor is the recommended approach and gives you the capability to adjust your display for optimal readability. What is your concern with using a variable resistor? Every electronic experimenter's parts bin should have a selection of potentiometers.
If you're just experimenting and don't want to have to go out and buy a new component, you could make a simple voltage divider to set a fixed contrast level. I'd take a relatively large value resistor (say 10K ohm) from V+ to the contrast pin and a smaller resistor (1K ohm) from the contrast pin to ground. Your mileage may vary.
|
|
|
|
|
6
|
Using Arduino / Displays / Re: 16*2 Parallax serial lcd working but cant get to scroll
|
on: April 23, 2013, 05:55:55 pm
|
You also have the habit of persisting. I think your program is similar to the way I envisioned it. I think you could prettify your code by eliminating "d" and by cleaning up your "for" loops. You're placing the characters 1 by 1 in the "for" loop controlled by "i". I copied this concept. The LCDs I'm familiar with do not require placing the cursor prior to sequentially displaying the characters. In your program, you set the cursor prior to displaying each char. I left this in the "i" loop but I don't think it is necessary. Instead, setting the cursor prior to the start of each text message should be sufficient. In Setup, you issue a delay after clearing the LCD while in the main Loop, you don't. I'm not sure if this is intentional on your part. Your for loop "for (i = 0; i < d; i = i + 1) " would be more commonly written using a local variable i and using "i++" to increment the loop counter.for as in "for (int i =0; i<d; i++)". If you just substitute this in your code, you'll probably get an error due to the "(i = 0);" that occurs later. This is because this use of i is outside the scope of the loop. You can get rid of this error by deleting "(i = 0);". There's no need for you to manually reinitialize "i" since the loop will do that for you. #include "SoftwareSerial.h" const int TxPin = 6; //Output signal to LCD SoftwareSerial mySerial = SoftwareSerial(255, TxPin);
char topLine[] = {"See Ya Later--->"}; // Message string int i; // Cursor adder position int z; // Cursor starting position
void setup() { pinMode(TxPin, OUTPUT); digitalWrite(TxPin, HIGH); mySerial.begin(9600); //Transmit at 9600 baud delay(50); mySerial.write(17); // Turn backlight on mySerial.write(22); // disable cursor disable blink mySerial.write(12); // clear screen and place cursor at upper left corner delay(5); // Required delay z = 128; // Variable used for cursor starting position }
void loop() { for (int positionOffset = 0; positionOffset < 17; positionOffset ++) //initial direction { mySerial.write(12); // Clear screen mySerial.write(z+positionOffset); //set the cursor for(int i=0; i<16-positionOffset; i++) //print the message char by char { mySerial.write(z+i); // Writes cursor position [Kerby - I hope this line isn't needed] //since you've already set the cursor above mySerial.print(topLine [i]); // Writes letters in char string } delay(500); } }
|
|
|
|
|
7
|
Using Arduino / Displays / Re: 16*2 Parallax serial lcd working but cant get to scroll
|
on: April 17, 2013, 01:13:53 pm
|
When I've done scrolling, I just let the string march off to the right without terminating it at the end of the array. So I haven't limited the string length like you're suggesting. Probably sloppy programming on my part but it's the was the arduino sample does it. I think I can do what you want with a parallel interface using: #include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins ////LiquidCrystal lcd(8, 9, 4, 5, 6, 7); ///use your declarations char topLine[] = "There I go ---> "; //16 characters to match LCD
void setup() { /////Use your setup }
void loop() { for (int positionOffset = 0; positionOffset < 17; positionOffset ++) //initial direction { lcd.clear(); lcd.setCursor(positionOffset, 0); // scroll one position right for (int i=0; i<17-positionOffset; i++) lcd.print (topLine[i]); //print only visible characters delay(1000); } } For your serial LCD, I think you make changes to the three lcd statements in the Loop. To clear the lcd, use mySerial.write(12); to position the cursor, mySerial.write(128+positionOffset); To print the visible characters will require mySerial.print(topLine ); Also in the declarations change your character arrays to just use the one I do.
I'm sorry that I can't test this since I don't have a serial LCD.
|
|
|
|
|
8
|
Using Arduino / Displays / Re: 16*2 Parallax serial lcd working but cant get to scroll
|
on: April 16, 2013, 09:50:54 pm
|
|
Where in your code are you controlling the cursor location? In your loop, the instruction mySerial.write(128); moves the cursor to line 0, position 0 and you write your message. Okay, that makes sense to me but the second time through, don't you want to write your message to line 0, position 1 using mySerial.write(129); ? And the third time through to position 2 and ..... So what your loop should be incrementing is the cursor position, not the string identifier.
In an earlier post, that's why I asked if you'd figured out how to place a character anywhere on the LCD. If you can do that, scrolling will be easy. Be aware, as Don and the Parallax-Serial-LCDs-Product-Guide-v3.1.pdf point out, that you just can't blindly keep incrementing the cursor location because there are some things the addressing does to accommodate a variety of LCD configuration. For the first 16 positions this won't be a problem but in the homework assignment I gave you, you need to figure out how to handle position 0 on line 1.
Hey, your method might not be efficient but you've obviously worked hard to solve your problem. Brute force triumphs.
|
|
|
|
|
10
|
Using Arduino / Displays / Re: Best Way to Physically Hookup LCD To Arduino
|
on: April 16, 2013, 03:15:02 pm
|
|
A picture and a model number would help answer your question about two rows.
I think my soldering skills are on the low end of medium on the scale of ability. I am limited by aging eyesight. I have successfully soldered wires to at least a dozen LCDs without damaging any of them. The other ends of the wires can then be stuck in a breadboard or the terminals on the arduino.
At least a couple of times, I have use header pins. Once when I did it this way, the plastic holding the pins got too hot and some of the pins shifted upward. I was able to remove and redo.
|
|
|
|
|
12
|
Using Arduino / Displays / Re: display
|
on: April 13, 2013, 05:15:10 pm
|
|
It seems like I spend more time working on your project than you do. While it's true that some pictures are worth a thousand words, the two you posted together aren't going to exceed thirteen, tops.
There are basically three things that can be wrong: 1. You've got a wiring error. A picture that clearly showed your wiring would help eliminate this as a problem. There are only 5 wires going to the display. There should be a sixth wire connecting the grounds. Without a clear picture of these, you're on your own.
2. Your code is incorrect. The sample program here is very short and simple. When you compile this program, does it compile error free and download to the arduino error free? The library cited below notes that there are tm1638s with inverted logic. Have you checked to see if you have one of those versions by following his directions about interfacing using "InvertedTM1638.h" and "InvertedTM1638 module(8, 9, 7);"
3. Your hardware is broken. 3a. I assume that you've used your arduinos before and they've operated properly. If you're concerned that the arduino is the problem, you could blink LEDs from pins 7, 8, and 9 to be sure that those pins don't have a problem. 3b. Your display is broken. I don't know of a simple test to eliminate this possibility. 3c. Your external power supply is broken. If you're reading 11.9 volts, I think you can eliminate this possiblity.
No errors in program? ???? // define a module on data pin 8, clock pin 9 and strobe pin 7 TM1638 module(8, 9, 7); Is your question "what does 'define a module'" mean? If so, it means you need to use the right set up for your display, either TM1638 module(8, 9, 7);or InvertedTM1638 module(8, 9, 7); depending on which module you have
|
|
|
|
|
13
|
Using Arduino / Displays / Re: display
|
on: April 13, 2013, 02:33:33 pm
|
|
The pictures aren't very clear. The yellow wire is connected between Data and digital pin 8? The purple/orange is CLK and digital pin 9? Red is STB and digital pin7?
I'm guessing that the 11.9 displayed in the upper right is your external 12 volt power supply? I can't see if the ground of this power supply is tied to the arduino ground. Is that the shadowy black wire upper left?
You've measured the 11.9 volts at the 1638 board?
You might be able to take a better picture if you put the arduino right next to the 1638 and used short jumpers to the three pins. From this picture, I can't tell one wire from another. Color coding wires is always a good idea. And I'm not sure which is red and which is orange.
The sample code above compiles error free?
|
|
|
|
|
14
|
Using Arduino / Displays / Re: display
|
on: April 12, 2013, 05:34:15 pm
|
|
Your code compiles without errors?
Can you post a clear photo showing the wiring between the arduino and the display?
|
|
|
|
|