Show Posts
Pages: [1] 2 3 ... 6
1  Using Arduino / Displays / Re: LCD shield problem on: April 26, 2014, 12:54:10 pm
I think the comment below might be a good clue.
  // if analog input pin 0 is unconnected, random analog
  // noise will cause the call to randomSeed() to generate
  // different seed numbers each time the sketch runs.
  // randomSeed() will then shuffle the random function.

The shields I have used have Analog pin 0 used to get the keyboard input.  Check your shield schematic, if your shield is connected this way, this method of getting a random seed won't work.

While you're checking the schematic, also make sure that pin 7 is not used by the shield.  If it is, you may never be getting the initialization signal. 
2  Using Arduino / Displays / Re: 16x2 LCD nearly works - but has a few strange characters. Why??? on: April 04, 2014, 09:41:07 pm
What is the best way to do this, simply print it to the Serial Monitor or are you suggesting something else (can you please expand, thank you).
Yes, I think that's a good approach.  Something like this:

#include <SoftwareSerial.h>
SoftwareSerial id20(3,2); // virtual serial port
int i;

void setup()
{   Serial.begin(9600);

void loop()
{   if(id20.available())
    {  i =;                // receive character from ID20
       Serial.print("ASCII: ");        //send "ASCII:" to the serial monitor
       Serial.write(i);                //if the received character is not a printable ASCII character, you may see your garbage.
                                       //Christo says to expect 02 and 03 in your input stream.  In my tests, these two characters
                                       //print as blanks in the serial monitor.
       Serial.print("  Hex Value: ");
       Serial.println(i, HEX);         //send the hex value.  Christo says expect "2" and "3",

I haven't fully checked this and I don't have your RFID reader so I can't duplicate your stream.  If you're getting three characters, there is going to be an additional character besides the ones Christo notes.  You can determine what that character is by referring to an ASCII table afer you get the hex value.
3  Using Arduino / Displays / Re: 16x2 LCD nearly works - but has a few strange characters. Why??? on: April 04, 2014, 08:18:20 am
It looks like you've done a good job of getting the LCD to communicate and display.  I suspect that your serial input is the source of your garbage characters.

Have you checked the output from i =; // receive character from ID20 ?

Are the garbage characters always the same?  Could you just check the incoming string and ignore those characters or just ignore all characters that are not alpha-numeric?
4  Using Arduino / Displays / Re: CTE35 was not declared in this typel on: March 19, 2014, 09:01:12 pm
When I use the updated library from Henning Karlsen's site, I am able to compile after making the changes I mentioned in my prior post.  It would be nice if I could see if the display works but I don't own a CTE35.  I was only addressing the OP's inability to compile. 

I don't understand why you and I got different results.  I posted mine in case the OP continued to have problems after trying what worked for you.

5  Using Arduino / Displays / Re: CTE35 was not declared in this typel on: March 19, 2014, 03:58:57 pm
I thought luxxtek's approach was a good one.  So good, in fact, that I tried it myself. I didn't immediately post my results because I assumed that he and I would get similar results.  Instead, the results are very different.

It may be due to configuration.  I'm using Arduino 1.0.1 on a Linux (Mint) machine.  When I used the OP's sketch and the UTFT library from the Japanese site, I got the same error the OP did that "CTE35 was not declared in this scope".  When I used the library at Henning Karlsen, I got the sketch to compile after making a few small changes.  The first was to change
UTFT myGLCD(CTE35,38,39,40,41);
UTFT myGLCD(CTE35IPS,38,39,40,41);

I also had to edit Defaults.c to declare the fontdatatype (s) as constants by adding "const" as shown:
const fontdatatype SmallFont[1144]
const fontdatatype BigFont[3044]
const fontdatatype SevenSegNumFont[2004]

If I was smarter, maybe I could explain this discrepancy.
6  Using Arduino / Displays / Re: CTE35 was not declared in this typel on: March 18, 2014, 02:16:22 pm
I am using the UTFT library from TFT manufacturer website. They have provided an example sketch. TFT link is

I couldn't read the info on this site but I did find a link to download a UTFT library.  In this download, there was a document listing the supported displays.  I did not see the CTE35 listed.

When I looked at the UTFT.h file included in this download, I did not see the CTE35 listed in the definitions of displays. 

On the other hand, when I go to the modified UTFT library at

I see the CTE35IPS listed in the supported displays and the CTE35IPS defined in UTFT.h.

I still think you need to check which version of the library you are using.
7  Using Arduino / Displays / Re: CTE35 was not declared in this typel on: March 17, 2014, 02:49:06 pm
In this thread, the code notes that there is a  CTE modified UTFT library.
[See the notes in the post #1's sketch.]

Which UTFT library are you using?
8  Using Arduino / Displays / Re: problem with Sparkfun serial backlit 16x2 LCD on: March 04, 2014, 07:40:02 am
It is neater to remove the tracking garbage from the end of your quoted URLs.

It is even neater  smiley-grin to just insert the hyperlinks into your description using the "Insert Hyperlink" button with the little world icon.  You put an equals sign after the "url" before the "]" and paste the actual URL after that.

Thanks for pointing this out.  I was oblivious.
9  Using Arduino / Displays / Re: problem with Sparkfun serial backlit 16x2 LCD on: March 02, 2014, 11:15:19 pm
There are several ways to convert from the analog read values to another set of units.  Read about the map function, it's pretty slick.

If your goal is an ohmmeter, why to you want to read "real voltage"? 

For the erratic readings, this tutorial on smoothing should be interesting to you.
10  Using Arduino / Displays / Re: problem with Sparkfun serial backlit 16x2 LCD on: March 02, 2014, 10:25:54 pm
I'm not sure what you're trying to accomplish.  If it's periodic readings of the analog pin, you should be reading it in the loop() and not in setup().

I think you need to reposition the cursor before executing
     mySerial.write("                             "); // clear display

I don't understand why you've got the delay after you print the spaces.  Do you want to have the screen blanked for 1 second after each reading?
11  Using Arduino / Displays / Re: problem with Sparkfun serial backlit 16x2 LCD on: March 02, 2014, 06:09:18 pm
I think one problem is that you're using "println" instead of "print".  println sends a carriage return and a line feed that might be the last two strange characters you see.  That doesn't explain why you don't see the results of the analog read.

I don't see why you position the cursor both before and after the printing of the data.

On the other hand, if you position the cursor before you print your spaces, that will erase the old data but you still need to look into the LCD addressing.  From your code I'm guessing that you think you're erasing both lines on the LCD by sending out two lines of spaces.  The LCD addresses for the two lines aren't consecutive. 

12  Using Arduino / Displays / Re: LCD Value does not getting updatet after 5 seconds ?? on: February 22, 2014, 10:36:36 pm
It's probably not a good idea to check that the time interval is exactly 333 milliseconds.  Try replacing
if (millis() - lastmillis == 333)
if (millis() - lastmillis >= 333)

I don't know your hardware set-up so I tried using your IF loop condition in this simple code
unsigned long lastmillis = 0;
void setup()
{  Serial.begin(9600);
void loop()
{  if (millis() - lastmillis >= 333)
  {   Serial.println(lastmillis);
      lastmillis = millis(); // Uptade lasmillis

When I used "==" instead of ">=", it latched up at just under 13 seconds.  I'm not sure why I didn't duplicate your 5 seconds.  Maybe it's due to differences in the test configuration or maybe your estimate wasn't precise.  I know there was no need for precision here.
13  Using Arduino / Displays / Re: Use display LCD from Processing on: February 18, 2014, 03:39:02 pm
 I don't know Firmata but is looks like it is intended to use a host computer to control the Arduino.

What are you trying to do?  Use your PC to control the LCD display?  Or to have the LCD display data serially sent to the arduino?

If Firmata is controlling all the arduino I/O, I don't think the executing LiquidCrystal commands on the arduino is going to work.

Is your final desire to use Firmata or is it to send data serially from the host to the LCD using the arduino as the LCD controller?
14  Using Arduino / Displays / Re: Problem with coding functions using LiquidCrystal (LCD 16x2 screen) on: February 12, 2014, 02:51:38 pm
In this section of the code:
  int HIGH = 1;
  etat_courant_up = HIGH;
  etat_courant_down = HIGH;
  etat_courant_left = HIGH;
  etat_courant_right = HIGH;
  etat_previous_up = HIGH;
  etat_previous_down = HIGH;
  etat_previous_left = HIGH;
  etat_previous_right = HIGH;

Do you want an integer "HIGH" or are you defining "HIGH" as "1"?  I don't know enough C to know why my compiler complains about this but I suspect that one of the header files has previously defined "HIGH".
15  Using Arduino / Displays / Re: topway lmb162abc lcd on: February 09, 2014, 08:42:14 pm
Don has pointed out a couple of times that you haven't provided much in the way of clues to solving your mystery.  If everything else is fine except that printing a single "o"
makes the lcd screw up and currupt/change all the characters
that would be extremely remarkable.  Maybe you have the Inverted Jenny of the LCD world.  It would be a collector's item.

I use an LCD in my music player to display artists and song titles.  The data sent to the Arduino is actually unicode, not ASCII.  Regularly, the unicode characters are not in the HD44780 character set and a strange character is displayed.  I could probably fix this but since the only result is that an umlaut or an omega shows up as a SINGLE odd character, it doesn't bother me.

Are you in an English speaking country?  Did you buy the topway lmb162abc from an American supplier?  There are many different character sets in HD44780 based devices to accommodate different languages and applications.  If you echo the LCD output to the serial monitor, do you see the characters you expect?

Pages: [1] 2 3 ... 6