Friday 30 May 2014

Monday 26 May 2014

Hitachi LM038 LCD with Arduino

I bought 2 Hitachi LM038 LCDs at the car boot sale last weekend (new), wondering if I'd be able to make them work with an Arduino.

It was TOO easy :-)

I had bought 10 rows of 40 Header Pins on eBay, (so called, but actually various odds & sods of shorter lengths of pins) so soldered 2 rows of 7 pins into the LM038

I had also bought some 40 pin Dupont Male to Female Ribbon Cable (Jumper Wires)


I found this very helpful page:

http://www.m0yom.co.uk/index.php/blog/34-general/62-using-the-hitachi-lm038-lcd-with-the-arduino

tried it, and it worked. TOO easy... BUT... What's with his insane pin order?

It was a bit fraught hooking it up!

I noticed that the initialisation in the start of his code was in the same order as his twisted wiring instructions, so I thought I'd try re-ordering the pins in a more sane manner & seeing if changing the initialisation string to match would work too... of course it did! :-)

So now I have:

LCD PinArduino Pin
1GND
2+5V
3GND via Resistor for contrast control
42
53
64
75 (Optional)
86 (Optional)
97 (Optional)
108 (Optional)
119
1210
1311
1412

And I changed my code to:



#include <LiquidCrystal.h>
/*
 * LiquidCrystal display with:
 * LCD 4 (RS)  to Arduino pin 2
 * LCD 5 (R/W) to Arduino pin 3
 * LCD 6 (E)   to Arduino pin 4
 */

LiquidCrystal lcd(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);

void setup()

{

    // Print a message to the LCD.

    lcd.print("hello, world!");

}

void loop()

{

}

Friday 23 May 2014

Setting up mpide ( IDE for Unu32 ) on Linux


http://chipkit.net/started/

http://chipkit.net/started/install-chipkit-software/install-mpide-linux/

https://github.com/chipKIT32/chipKIT32-MAX

Trouble getting mpide to compile for Uno32

When I tried to verify or compile with mpide (from http://chipkit.net/started/install-chipkit-software/install-mpide-linux/ ) on 64bit Debian (Jessie/Sid) I got an error:


Cannot run program "/.../hardware/pic32/compiler/pic32-tools/bin/pic32-g++": error=2, No such file or directory

How I fixed it was:

$ sudo dpkg --add-architecture i386
$ sudo aptitude update
$ sudo aptitude upgrade
$ aptitude install gcc-multilib

I don't know if I needed the --add-architecture i386

The other thing I found was when I tried to run ldd on the binary that was failing, it told me:

$ ldd pic32-g++
not a dynamic executable

It *should* have told me this:

$ ldd pic32-g++
linux-gate.so.1 (0xf771a000)
libm.so.6 => /lib32/libm.so.6 (0xf76bc000)
libc.so.6 => /lib32/libc.so.6 (0xf7511000)
/lib/ld-linux.so.2 (0xf771b000)


$ file ./pic32-g++
./pic32-g++: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.0.0, stripped

I found these 2 pages were useful in finding the answer:

http://unix.stackexchange.com/questions/75054/ldd-tells-me-my-app-is-not-a-dynamic-executable

http://colinharrington.net/blog/2011/08/running-mpide-chipkits-arduino-ide-remake-64bit-ubuntu/


Friday 16 May 2014

7x4 font

https://github.com/aguegu/dot-matrix/blob/master/font/vfont_7x4.c