Arduino Uno + Wifi Shield + PS2 Keyboard + LCD Display


i'm new in arduino community , i'm facing problem when try use ps2 keyboard , lcd display (16x2) on arduino uno wifi shield.

i write keyboard , display in lcd before sending webservice.

here problem:

when use keyboard , display on arduino without wifi shield --> ok. can write on display key has been pressed.
when use keyboard , display on arduino wifi shield --> ok until write on display. write on display function lcd.print(), keyboard not work anymore (it detect character '2' every time press key).
it's surprisingly because if dont use lcd.print(), keybord works without problem.

here part of code:

code: [select]

#include <liquidcrystal.h>
#include <ps2keyboard.h>

liquidcrystal lcd(12, 11, 2, 5, 6, 8);
ps2keyboard keyboard;

const int datapin = 9;
const int irqpin = 3;

void setup(){     
  keyboard.begin(datapin, irqpin);     
  lcd.begin(16, 2);
}

void loop(){
  checkkeyboard();
}

void checkkeyboard(){
  if (keyboard.available()) {

    char c = keyboard.read();

    // check of special keys
    if (c == ps2_enter) {
      serial.println();
    } else if (c == ps2_tab) {
      serial.print("[tab]");
    } else if (c == ps2_esc) {
      serial.print("[esc]");
    } else if (c == ps2_pagedown) {
      serial.print("[pgdn]");
    } else if (c == ps2_pageup) {
      serial.print("[pgup]");
    } else if (c == ps2_leftarrow) {
      serial.print("[left]");
    } else if (c == ps2_rightarrow) {
      serial.print("[right]");
    } else if (c == ps2_uparrow) {
      serial.print("[up]");
    } else if (c == ps2_downarrow) {
      serial.print("[down]");
    } else if (c == ps2_delete) {
      serial.print("[del]");
    } else {
      serial.print(c);
      displaytext(c);
    }
  }
}

void displaytext(char c){
  lcd.clear();
  lcd.setcursor(0,0);
  lcd.print("pressed key:");
  lcd.setcursor(0,1);
  lcd.print(c);
}



does know how solve problem?

thank in advance :)

quote
does know how solve problem?
certainly.

code: [select]
liquidcrystal lcd(12, 11, 2, 5, 6, 8);
don't connect lcd spi pins. pins 10, 11, 12, , 13 not available use.


Arduino Forum > Using Arduino > Programming Questions > Arduino Uno + Wifi Shield + PS2 Keyboard + LCD Display


arduino

Comments

Popular posts from this blog

invalid use of void expresion in FlexiTimer2 library

error: a function-definition is not allowed here before '{' token

LED Strip Code