Tried putting the multiplex pin on pin14 (analog 0), but same 'garbage' will get printed on the screen. Though it showed some promise, but after a couple of button presses, it went belly up again.
Though I suppose my wiring can be at fault for this test aswell... as in, all the LCD signal lines are on the analog port.. so always one of those is on pin 19.
Don't have a schematic, sorry, but I'll provide the next best thing, a table showing my wiring:
| Digital | device pin |
|---|---|
| 0 | bluetooth rx |
| 1 | bluetooth tx |
| 2 | range finder rx (NewSoftSerial) |
| 3 | range finder tx (NewSoftSerial) |
| 4 | multiplexer y0 |
| 5 | multiplexer y1 |
| 6 | multiplexer y2 |
| 7 | currently vacant :o |
| 8 | servo |
| 9 | servo |
| 10 | servo |
| 11 | servo |
| 12 | servo |
| 13 | servo |
| Analog | |
| 0 (14) | LCD DB4 |
| 1 (15) | LCD DB5 |
| 2 (16) | LCD DB6 |
| 3 (17) | LCD DB7 |
| 4 (18) | LCD RS |
| 5 (19) | multiplex z |
| Multiplexer | (output unless otherwise stated) |
| 0 | bluetooth reset |
| 1 | range finder reset |
| 2 | LCD enable |
| 3 | LCD buttons (analog input) |
| 4 | vacant |
| 5 | vacant |
| 6 | vacant |
| 7 | photo resistive sensor (analog input) |
The bluetooth device is a Promi-ESD module, the range finder is a URM37 ultrasonic sensor, in case it matters.
The LCD module is the LCD keypad shield by DFRobot.
The LCD shield: http://www.droboticsonline.com/index.php/arduino-lcd-keypad-shield.html
The product entry includes a library, and under additional information they have the manual.
The modifications I did to the library is changed the pin numbers.
And offcourse, change wherever it pulses the enable pin.. (just a single method), below the code for that method:
void LCD4Bit_mod::pulseEnablePin()
{
digitalWrite(mux[0], Enable[0]);
digitalWrite(mux[1], Enable[1]);
digitalWrite(mux[2], Enable[2]); //LCD 'enable' pin selected
digitalWrite(muxPin, LOW);
delayMicroseconds(1);
// send a pulse to enable
digitalWrite(muxPin, HIGH);
delayMicroseconds(1);
digitalWrite(muxPin, LOW);
delay(1); // pause 1 ms. TODO: what delay, if any, is necessary here?
}