Pages: [1]   Go Down
Author Topic: Wifi shield garbling LCD shield  (Read 481 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I have a SainSmart LCD Keypad Shield that I had working fine with a Leonardo on a project. I've added a wifi shield in between the LCD shield and the Leonardo. In order to not have the pins interfere with each other, I removed pins 4, 7 and 10 on the LCD shield and re-routed them to pins 1, 3 and A5. From what I can tell, after doing this, there are no pin conflicts.

So, here's the problem, if I write text the LCD keypad shield immediately after getting some data from the wifi board, a few characters of the LCD are scrambled. If I add just a 10 millisecond delay before writing to the LCD, it works fine. Other than that, both shields seem to work ok, though I haven't really fully tested the wifi shield by transferring data with the wifi shield since I want to solve this problem first.

Any ideas on what might be wrong? Thanks.

Here's some sample code where I added the 10 millisecond delays:

Code:
  // Start up wifi
  lcd.clear();
  lcd.print("Starting wifi");
 
  // check for the presence of the wifi shield:
  if (WiFi.status() == WL_NO_SHIELD) {
    lcd.clear();
    lcd.print("No Wifi Shield");
    // don't continue:
    while(true);
  }
 
  // attempt to connect to Wifi network:
  while ( status != WL_CONNECTED) {
    // Delay so the display isn't garbled.
    delay(10);
    lcd.clear();
    lcd.print("Wifi Connecting");
    // Connect to WPA/WPA2 network:   
    status = WiFi.begin(ssid, pass);

    // wait 10 seconds for connection:
    delay(10000);
  }
 
  lcd.clear();
  lcd.print("Connected");
  lcd.setCursor(0,1);
  ip = WiFi.localIP();
  // Delay so the display isn't garbled.
  delay(10);
  lcd.print(ip);
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 613
Posts: 49310
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Try over at http://snippets-r-us.com. The specialize in snippets. Here, we want to see ALL of your code, so that we can laugh at you connecting the LCD to the serial pins.
Logged

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

I guess you're referring to pin 1? I thought that pin wasn't necessarily used as a serial pin on the Leonardo since the USB over serial is separated from pins 0 and 1. Is that not correct?
Logged

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

I change the pin 4 rerouting so I'm using pin A4 rather than pin 1. No difference.
Logged

Pages: [1]   Go Up
Jump to: