Show Posts
Pages: [1] 2 3
1  Using Arduino / Displays / Re: Serial LCD Error Problem on: September 08, 2012, 05:38:42 pm
Hello, I'm new here and I hope this is the right place to post this. 

I'm using this code I found to try and use my 16x2 serial LCD I bought off of Sparkfun:

Code:


 

#include <SparkSoftLCD.h>

  // LCD transmit pin
#define LCD_TX 2

SparkSoftLCD lcd = SparkSoftLCD(LCD_TX);

void setup() {

   // setup lcd
 
 pinMode(LCD_TX, OUTPUT);
 lcd.begin(9600);
 lcd.clear();

   // hidden cursor
 lcd.cursor(0);

 show_setup();

 delay(1000);

}

void loop() {

    lcd.clear();
   
      // block-style blinking cursor
    lcd.cursor(2);
   
    lcd.print("Arming");
    delay(1500);
   
    lcd.clear();
   
      // hidden cursor
    lcd.cursor(0);
   
    lcd.print("16");
    lcd.cursorTo(2,1);
    lcd.print("---------------*");
   
    delay(1000);
   
    for( byte i = 15; i >= 1; i-- ) {
       
        lcd.scroll(false);
       
        // as we scroll left, we need to move our cursor to
        // the right to continue to show our countdown
        //
        // in this way, we achieve the sense that a fuse is getting
        // shorter...
        lcd.cursorTo(1,1 + (16 - i) );
        lcd.print(i, DEC);
       
        delay(1000);
     }
   
      // make last bit disappear
    lcd.scroll(false);
    delay(500);
    lcd.clear();
    lcd.cursorTo(2, 10);
    lcd.print("(boom)");
   
    delay(2000);
   
}



void show_setup() {
 
 lcd.print("I am setting up!");

   // send cursor to 2nd row, first column
 lcd.cursorTo(2,1);

 delay(500);

 for (byte i = 0; i <= 15; i++ ) {
     delay(150);
       // scroll display to the right
     lcd.scroll(true);
 }

 delay(1500);
 lcd.print("One more moment");


 for (byte i = 0; i <= 15; i++ ) {
     delay(150);
       // scroll back to the left, revealing our new text
     lcd.scroll(false);
 }

}


I keep getting the error: "SparkSoft LCD Does not name a type."


Any advice?  Thank you!

I believe your problem is with
Code:
SparkSoftLCD lcd = SparkSoftLCD(LCD_TX);

You should probably do it this way:
Code:
SparkSoftLCD lcd(LCD_TX);

or use the new operator after the equals sign assuming the arduino programming environment supports new.  I am not sure.  If it is standard C++ or even Java then it should.

2  Using Arduino / Displays / Re: new LiquidCrystal library problems on: September 08, 2012, 05:28:38 pm
Thanks everyone for your help. The serial LCD with the 595 shift register is working now so I will mark this conversation as solved.


If I could figure out how to mark it as solved that is. 
3  Using Arduino / Displays / Re: new LiquidCrystal library problems on: September 08, 2012, 12:29:33 pm
Thanks everyone for your help. The serial LCD with the 595 shift register is working now so I will mark this conversation as solved.
4  Using Arduino / Displays / Re: new LiquidCrystal library problems on: September 08, 2012, 12:27:04 pm
The schematics that are published in the library's wiki have been tested and are working with LCD library. They all have their corresponding bench mark. There are several schematics which I haven't published in the wiki for the SR2W and SR3W class but they are well documented in the header files.

Review the connections of to the board and make sure that the initialization of the library is correct by passing the correct pin assignement (data, clk, enable). How are you initializing the library? As you have it wired it should be: LiquidCrystal_SR iLCD(2, 3, 4);

On the published wiring, at first glance, the whole thing looks OK appart from the 74HC595 ground pin (which you have it floadting) looks alright.

Ah, good point.  I had been messing around with the code so much, I forgot to check that the example sketch was using the correct pins.  So, after grounding pin 8, changing the pins to what they should be, and turning up the contrast, it works now.  Thanks a lot.
5  Using Arduino / Displays / Re: new LiquidCrystal library problems on: September 08, 2012, 12:20:18 pm
Pin 8 of the 74HC595 has no ground it is connected to several other pins but not ground.

Doc

Ah, I missed that, thanks.  Pin 8 and 13 should have been grounded, they are now. Unfortunately, that did not help, still a blank display. 
6  Using Arduino / Displays / Re: new LiquidCrystal library problems on: September 07, 2012, 01:52:00 am
You need to connect a 10k pot to adjust the contrast. Where are you connecting the contrast pin to?

Gnd---|----+5V
         |
         \/
         Pin 3 of LCD

Attached is a picture of my breadboard.

7  Using Arduino / Displays / Re: new LiquidCrystal library problems on: September 07, 2012, 01:49:30 am
Contrast for the LCD?

Yes, I have a 10K pot.
8  Using Arduino / Displays / Re: new LiquidCrystal library problems on: September 06, 2012, 05:08:38 pm
Where did you place the Library? Beacause it is not finding it.

Okay, I figured out what was going on now, when I unzipped it I had an extra folder as in \LiquidCrystal_V1.2.1\LiquidCrystal.  I copied all the files to \LiquidCrystal_V1.2.1 and deleted the LiquidCrystal folder.  Then I rename the \LiquidCrystal_V1.2.1 to just LiquidCrystal and now it compiles okay.  Of course the LCD still does not work for some reason.  I am not sure why, I used the exact circuit from the web page.
9  Using Arduino / Displays / Re: new LiquidCrystal library problems on: September 06, 2012, 04:52:12 pm
Can you put a snippet of the error you are getting?
The library in independent of the version you are using.
Do you have any other LiquidCrystal library other than the New LiquidCrystal installed in your Arduino library folder?

I tried it in Windows and received the same error as before.  I am not sure what is going on.  It does not seem to be operating system related and I download new version of both Arduino 1.01 and the LiquidCrystal library.
10  Using Arduino / Displays / Re: new LiquidCrystal library problems on: September 06, 2012, 04:35:08 pm
Can you put a snippet of the error you are getting?
The library in independent of the version you are using.
Do you have any other LiquidCrystal library other than the New LiquidCrystal installed in your Arduino library folder?

I kind of did originally, but here is the entire error that is reported when I run the HelloWorld_SR example:
Code:
HelloWorld_SR.pde:-1: error: ‘LiquidCrystal_SR’ does not name a type
HelloWorld_SR.cpp: In function ‘void setup()’:
HelloWorld_SR.pde:-1: error: ‘lcd’ was not declared in this scope
HelloWorld_SR.cpp: In function ‘void showHappyGuy(int)’:
HelloWorld_SR.pde:-1: error: ‘lcd’ was not declared in this scope


And here is the entire sketch:
Code:
#include <Wire.h>
#include <LiquidCrystal_SR.h>

LiquidCrystal_SR lcd(8,7,TWO_WIRE);
//                   | |
//                   | \-- Clock Pin
//                   \---- Data/Enable Pin

// Creat a set of new characters
byte armsUp[8] = {0b00100,0b01010,0b00100,0b10101,0b01110,0b00100,0b00100,0b01010};
byte armsDown[8] = {0b00100,0b01010,0b00100,0b00100,0b01110,0b10101,0b00100,0b01010};

void setup(){

  lcd.begin(16,2);               // initialize the lcd

  lcd.createChar (0, armsUp);    // load character to the LCD
  lcd.createChar (1, armsDown);    // load character to the LCD

  lcd.home ();                   // go home
  lcd.print("LiquidCrystal_SR");
}

void loop(){
  // Do a little animation
  for(int i = 0; i <= 15; i++) showHappyGuy(i);
  for(int i = 15; i >= 0; i--) showHappyGuy(i);
}

void showHappyGuy(int pos){
  lcd.setCursor ( pos, 1 ); // go to position
  lcd.print(char(random(0,2))); // show one of the two custom characters
  delay(150); // wait so it can be seen
  lcd.setCursor ( pos, 1 ); // go to position again
  lcd.print(" "); // delete character
}

Also, I tried this in virtualbox using 32-bit Ubuntu, but still the same failure.  I think I will go and see if Windows does the same thing. 

11  Using Arduino / Displays / Re: new LiquidCrystal library problems on: September 06, 2012, 02:43:41 pm
You need to delete the stock LiquidCrystal library and replace it by this one. It has the same functionality as the stock library but more performant. If you wish, you can store the stock library somewhere that is not the library folder.

Okay, thanks though that sounds a bit strange to me, but I'll give it a try. 

Okay, well that did not work.  Even though I replaced the LiquidCrystal display with LiquidCrystal_V1.2.1 and renamed that library to LiquidCrystal, it does not work and gives me the same error as before.  Now, what I am wondering is whether this library is specific to either a 32-bit platform or not.  I am using a 64-bit platform with 64-bit Arduino IDE.  Could this be the problem?  Perhaps I will install the 32-bit version of the IDE in virtualbox and see what happens.
12  Using Arduino / Displays / Re: new LiquidCrystal library problems on: September 06, 2012, 12:46:14 pm
You need to delete the stock LiquidCrystal library and replace it by this one. It has the same functionality as the stock library but more performant. If you wish, you can store the stock library somewhere that is not the library folder.

Okay, thanks though that sounds a bit strange to me, but I'll give it a try. 
13  Using Arduino / Displays / Re: new LiquidCrystal library problems on: September 06, 2012, 04:36:07 am
In that case, I would think that you haven't correctly installed the library.

I unzipped it and added it to the library folder though I did have to rename it slightly because The ide did not like the underscores in the library name.
14  Using Arduino / Displays / Re: new LiquidCrystal library problems on: September 06, 2012, 04:31:34 am
The best thing is to use the sample sketches that come with the library.
The wiring page is to show how to initialize the library based on the wiring.

I did use the HelloWorld_SR example and it did not compile either.  But, if I try the regular LiquidCrystal library HelloWorld example, it compiles just fine.
15  Using Arduino / Displays / Re: new LiquidCrystal library problems on: September 06, 2012, 04:29:30 am
I just downloaded the library. I had to include the Wire library, and add an empty loop() function, and then your code compiled.

Yes, I did that also, still the same result.
Pages: [1] 2 3