Pages: [1] 2   Go Down
Author Topic: Noob trouble  (Read 2648 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have a sainsmart 1602 lcd i'm trying to get to work when i try the Hello world sketch i get this error./*


avrdude:  stk500_getsync(): not in sync: resp=0x00                                             Thanks mike
Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 73
Posts: 7197
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Your arduino is not accepting the sketch. There are a whole bunch of reasons but you provided zero details of what you did. This is like posting on a "medicine" website saying "I'm sick. What drug should I take?".  Now get to work on the following if you hope to get any sort of help.
1) Post your code. Don't say "I used exactly the code from ..."
2) Post LCD spec sheet
3) Post high-res pictures of how you connected your circuits, no fuzzy pictures. We need to see all details.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

here is code i used.                                                                                                                                                                                    LiquidCrystal Library - Hello World
 
 Demonstrates the use a 16x2 LCD display.  The LiquidCrystal
 library works with all LCD displays that are compatible with the
 Hitachi HD44780 driver. There are many of them out there, and you
 can usually tell them by the 16-pin interface.
 
 This sketch prints "Hello World!" to the LCD
 and shows the time.
 
  The circuit:
 * LCD RS pin to digital pin 12
 * LCD Enable pin to digital pin 11
 * LCD D4 pin to digital pin 5
 * LCD D5 pin to digital pin 4
 * LCD D6 pin to digital pin 3
 * LCD D7 pin to digital pin 2
 * LCD R/W pin to ground
 * 10K resistor:
 * ends to +5V and ground
 * wiper to LCD VO pin (pin 3)
 
 Library originally added 18 Apr 2008
 by David A. Mellis
 library modified 5 Jul 2009
 by Limor Fried (http://www.ladyada.net)
 example added 9 Jul 2009
 by Tom Igoe
 modified 22 Nov 2010
 by Tom Igoe
 
 This example code is in the public domain.

 http://www.arduino.cc/en/Tutorial/LiquidCrystal
 */

// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("hello, world!");
}

void loop() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 1);
  // print the number of seconds since reset:
  lcd.print(millis()/1000);
}                                                                                                                 Ordered kit off Amazon and Sainsmart did not send spec sheet.


* 004.JPG (129.16 KB, 615x461 - viewed 33 times.)

* 005.JPG (127.29 KB, 615x461 - viewed 23 times.)

* 006.JPG (113.71 KB, 615x461 - viewed 29 times.)

* 007.JPG (115.12 KB, 615x461 - viewed 26 times.)
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 52
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Your Arduino is not communicating properly with the program. Things to check:

- Proper USB connection
- Correct COM port selected. If you are in Windows you can check the device manager. Look under "Ports (COM & LPT)," you should see something like "USB Serial Port (COM3)." Make sure you have the correct port selected in the Arduino IDE under "Tools -> Serial Port."
- Correct board selected under "Tools -> Board."
- Did you try multiple times? Occasionally, for whatever reason, I get that error and the program won't upload. I just upload again and it will work.

Have you used this particular Arduino board before? I bought an Arduino on SparkFun that didn't come with the bootloader installed. It's possible that this is your problem, assuming all of your settings are correct. If you used the board successfully before then that is not the problem. SparkFun does tend to be a little sloppy about that anyway with their products, probably more so than the "Official" Arduino guys.
Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 73
Posts: 7197
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Did blink example work without the shield?
Where is the web link to the shield?
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

 Yeah blink worked with out shied.  and here is link to to shield,     http://www.amazon.com/SainSmart-Arduino-Keypad-Shield-Sensor/dp/B0076H2T68/ref=sr_1_70?s=electronics&ie=UTF8&qid=1332823082&sr=1-70       Thanks for the help. Mike
Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 73
Posts: 7197
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The LCD shield has next to no documentation:
Quote
The SainSmart LCD Keypad Shield for Arduino: It includes a 16x2 HD44780 White on Blue LCD module and a 5 push button keypad for menu selection and user interface programming. Fully assembled. On-line Arduino tutorial and example code. Compatible with Arduino Uno, Mega, Duemilanove. Uses digital pins 4 - 10, and analog pin 0.

Can't help.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yeah i found that out will be getting another one . Did get it to work after i got the RAR file from them. here is shetch.                                         /*
  The circuit:
 * LCD RS pin to digital pin 8
 * LCD Enable pin to digital pin 9
 * LCD D4 pin to digital pin 4
 * LCD D5 pin to digital pin 5
 * LCD D6 pin to digital pin 6
 * LCD D7 pin to digital pin 7
 * LCD BL pin to digital pin 10
 * KEY pin to analogl pin 0
 */

#include <LiquidCrystal.h>

LiquidCrystal lcd(8, 13, 9, 4, 5, 6, 7);

char msgs[5][16] = {"Right Key OK ",
                    "Up Key OK    ",               
                    "Down Key OK  ",
                    "Left Key OK  ",
                    "Select Key OK" };

int adc_key_val[5] ={50, 200, 400, 600, 800 };
int NUM_KEYS = 5;
int adc_key_in;
int key=-1;
int oldkey=-1;

void setup()
{
  lcd.clear();
  lcd.begin(16, 2);
  lcd.setCursor(0,0);
  lcd.print("ADC key testing");
}

void loop()
{
  adc_key_in = analogRead(0);    // read the value from the sensor
  key = get_key(adc_key_in);  // convert into key press
 
  if (key != oldkey)   // if keypress is detected
   {
    delay(50);  // wait for debounce time
    adc_key_in = analogRead(0);    // read the value from the sensor
    key = get_key(adc_key_in);    // convert into key press
    if (key != oldkey)   
    {   
      lcd.setCursor(0, 1);
      oldkey = key;
      if (key >=0){
           lcd.print(msgs[key]);             
      }
    }
  }
 delay(100);
}

// Convert ADC value to key number
int get_key(unsigned int input)
{
    int k;
   
    for (k = 0; k < NUM_KEYS; k++)
    {
      if (input < adc_key_val[k])
 {
            return k;
        }
   }
   
    if (k >= NUM_KEYS)k = -1;  // No valid key pressed
    return k;
}

Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 73
Posts: 7197
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Please read:

http://arduino.cc/forum/index.php/topic,97455.0.html

Item 6 about posting code with # button.

Remove 13 from lcd definition.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I would like to thank you for helping me i'm new to this so thanks i'll read up thanks again for pointing me in the right direction.  Mike
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 36
Posts: 4323
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
* LCD BL pin to digital pin 10
You might want to reconsider this part.  Check this out (http://arduino.cc/forum/index.php/topic,96747.msg725978.html#msg725978).

[Edit] You may find some help in this thread as well (http://arduino.cc/forum/index.php/topic,99503.msg748826.html#msg748826).


Don
« Last Edit: April 12, 2012, 10:13:28 pm by floresta » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks read the post i'll be putting diode in. My board matchs the one in reply 10 .  Thanks for the heads up.  Mike
Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 73
Posts: 7197
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Try LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Try LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

thanks that worked
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 36
Posts: 4323
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Try LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

thanks that worked

That's what you were told back in Reply #8 and in Reply #10....

Don
Logged

Pages: [1] 2   Go Up
Jump to: