Show Posts
Pages: [1] 2 3 ... 293
1  Using Arduino / Displays / Re: 20x4 lcd problem on: September 16, 2014, 11:13:34 pm
Please edit your post.  Highlight the stuff that is code and then press the 'code' button which looks like an octothorpe ( # ). 

If you are having trouble getting an LCD to work properly then the last thing you want is to have things changing on you as you troubleshoot.  Basically this means that loop() should be empty (nothing between the { } brackets).

Try these two sketches and see what happens (you can add two more display lines to the first one).


Code:
#include <LiquidCrystal.h>

//LiquidCrystal lcd(RS, E, D4, D5, D6, D7);
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);      // put your pin numbers here

void setup()
  {
  lcd.begin(16, 2);                          // put your LCD parameters here
  lcd.print("hello, world!");
  lcd.setCursor(0,1);
  lcd.print("it works!");
  }

void loop()
  {
  }


Code:
#include <LiquidCrystal.h>

//LiquidCrystal lcd(rs,en,d4,d5,d6,d7);
  LiquidCrystal lcd(12, 11, 5, 4, 3, 2);       // put your pin numbers here

void setup()
  {
    lcd.begin(20, 4);                          // put your LCD parameters here
    for (char i=47; i<127; i++)                // send 80 consecutive displayable characters to the LCD
      {
        lcd.print(i);
        delay(100);                            // this delay allows you to observe the addressing sequence
      }
  }

void loop()
  { 
  }

Don
2  Using Arduino / Displays / Re: hd44780 based 16x2 LCD repeats after 8 characters on: September 16, 2014, 10:15:25 am
Nobody's called me that since I retired 17 years ago.  They have called me lots of other things though.

Don
3  Using Arduino / Displays / Re: hd44780 based 16x2 LCD repeats after 8 characters on: September 15, 2014, 10:50:53 pm
I would say that your module is defective.  

One of the blobs on the back is the main controller which contains all of the memory along with the circuitry to display the 16 characters on the left half of the display.  The other blob is an auxiliary controller which contains the circuitry to display the 16 characters on the right half of the display.

One possibility is that there is some miscommunication going on between the two controllers that is most likely due to a damaged controller or a damaged trace (or traces) on the pc board.

Another possibility is that there is a problem with the memory addressing within the main controller whereby the information for one screen location is being stored in multiple memory locations.  In either case you need a new display.


Don
4  Using Arduino / Displays / Re: hd44780 based 16x2 LCD repeats after 8 characters on: September 15, 2014, 08:58:42 pm
I don't think that there is anything that you could do with your wiring to get this, and it would take some pretty tricky code as well.

Try running the following sketch and see what the sequence of events is.  Specifically, does the problem occur (I think it will) and if so do the duplicate letters appear on the display at the same time.  Increase the intercharacter delay if necessary.


Code:
#include <LiquidCrystal.h>

//LiquidCrystal lcd(rs,en,d4,d5,d6,d7);
  LiquidCrystal lcd(12, 11, 5, 4, 3, 2);       // put your pin numbers here

void setup()
  {
    lcd.begin(20, 4);                          // put your LCD parameters here
    for (char i=47; i<127; i++)                // send 80 consecutive displayable characters to the LCD
      {
        lcd.print(i);
        delay(100);                            // this delay allows you to observe the addressing sequence
      }
  }


void loop()
  { 
  }
Don
5  Using Arduino / Project Guidance / Re: 20x4 LCD showing long text files via SD card on: September 15, 2014, 07:51:40 pm
Regardless of your overall approach you should be aware of the fact that you are going to have to do a bit of work with each group of 80 characters.

If you use the LiquidCrystal library that comes with the IDE, or any of the varients based on that library, you will have to deal with 20 characters at a time and reposition the cursor after each group of 20.

Otherwise if you send all 80 characters at once you will find that the first 20 are on line 1, the next 20 are on line 3, the next 20 are on line 2 and the last 20 are on line 4.  This is due to how the LCD controller works, not due to a flaw in the library. 

This can and has been corrected by software.  One example is a library that was primarily written to deal with 40x4 displays but which will work with 20x4 as well.  To get a copy start here:--> http://code.google.com/p/liquidcrystal440/ and follow the Downloads link to get to the latest version.

Then of course there is the problem of correctly hyphenating words that extend from one line to another....


Don
6  Using Arduino / Displays / Re: LCD - CustomCharacter:117: error: call of overloaded 'write(int)' is ambiguous on: September 15, 2014, 07:29:10 pm
Quote
why did u use the ""lcd.write((byte)0);""" instead of "lcd.write(0);"  

It's because of how the Arduino IDE deals with 'writing'.  The complete explanation can be found here:  http://forum.arduino.cc/index.php?topic=174883.msg1299547#msg1299547.

Scroll up a few posts (http://forum.arduino.cc/index.php?topic=174883.msg1298248#msg1298248) and I explain how you could have used:
Code:
lcd.write(8);
 

Don
7  Using Arduino / Project Guidance / Re: RF receiver, Pin output amperage? on: September 15, 2014, 07:06:13 pm
You could start by using Google to search for Arduino pin change interrupt.

Then, since you want to sense when your pin goes high you could look for a mode that triggers when the pin goes from low to high.


Don
8  Using Arduino / Displays / Re: LCD connection on: September 15, 2014, 09:12:44 am
Quote
Are they the PCB-mount tactile type?  If so, someone posted a tip about them a while - if you wire to opposite corners, you are guaranteed to not have a short.

That's a great idea for loose switches on a workbench or when designing a pc board.  It will also work if you can somehow mount the switch over the gap in the middle of a solderless breadboard (but I don't think they are large enough to bridge the gap).  If you mount them on either side of the gap they still have to be oriented properly.

Don
9  Using Arduino / Displays / Re: LCD connection on: September 15, 2014, 09:04:28 am
Quote
Why can I only see characters 0 -7 on the lcd on rows 0 and 1?  I have the LCD object defined as 16,2 but alas no luck seeing the characters after column 7.

This sounds like it may be a problem with the connections between the display and the pc board.  Do a search on this site for 'zebra' (I'm not kidding) to find some topics concerning this.

Quote
is it possible that I have it in 8 bit mode and only have the four data wires connected?? or would that just not show anything onscreen?

In this case you would see a single row of blocks on the screen.

It's not likely to be software related, but just in case you should try writing data to every memory location in the LCD controller.


Code:
#include <LiquidCrystal.h>

//LiquidCrystal lcd(rs,en,d4,d5,d6,d7);
  LiquidCrystal lcd(12, 11, 5, 4, 3, 2);       // put your pin numbers here

void setup()
  {
    lcd.begin(20, 4);                          // put your LCD parameters here
    for (char i=47; i<127; i++)                // send 80 consecutive displayable characters to the LCD
      {
        lcd.print(i);
        delay(100);                            // this delay allows you to observe the addressing sequence
      }
  }


void loop()
  { 
  }

Don
10  Using Arduino / Displays / Re: LCD connection on: September 14, 2014, 09:03:48 pm
Up some pictures of your hardware

Why didn't anyone else think of this ????

Don
11  Using Arduino / Displays / Re: LCD connection on: September 14, 2014, 02:13:01 pm
Quote
is there any reason why I cant just simply connect my LCD with the following connections?

Code:
RS - pin 4 (digital 2)
E - pin 6 (digital 4)

d4 - pin 11(digital 5)
d5 - pin 12(digital 6)
d6 - pin 13 ( digital 7)
d7 - pin 14 (digital 8)

And then define those pins in the code with the following line:

Code:
LiquidCrystal lcd(2,4,5,6,7,8);

This part is correct.  The tutorial doesn't explain how this works, it's buried here http://arduino.cc/en/Reference/LiquidCrystalConstructor.  By the way, do you see why the use of code tags is important to correctly present your code?

In order to have any chance at diagnosing your problem we need more information.  This would include not only a photo of your setup but the complete sketch as well.


Don
12  Using Arduino / Project Guidance / Re: RF receiver, Pin output amperage? on: September 14, 2014, 01:52:45 pm
Why are you setting the pin mode for one pin in setup and the other in loop?

You should probably be looking for a change in the receive pin level, not just the level itself.
This is also a job better handled by interrupts than by polling.


Don
13  Using Arduino / Displays / Re: My LCD does not display characters.. on: September 14, 2014, 01:45:12 pm
Quote
I followed your advice and still the same result.

You didn't follow the last paragraph of my advice.


Don
14  Using Arduino / Displays / Re: show message on lcd for certain amount of time before writing new message on: September 13, 2014, 11:33:22 pm
Quote
kinda like blink without delay but for lcds?

That is essentially the technique that you should use. 
- You will initially have the first message displayed.
- When the event happens you will display the new message and start counting milliseconds
- If the elapsed time is not up you will just continue doing whatever you should be doing
- If the elapsed time is up you will display the original message again and continue doing whatever you should be doing .


Don
15  Using Arduino / Displays / Re: My LCD does not display characters.. on: September 13, 2014, 11:18:40 pm
For less than 2 bucks.
. . .

For less than 2 bucks he may just exchange one set of problems for another.  Have you seen all the posts relating to getting I2C adapters to work?

Also - that board claims to do IIC/I2C/TWI/SPI.  Now the first three are all the same but does it really also do SPI?


Don
Pages: [1] 2 3 ... 293