It’s always more interesting to view results on an LCD rather than the serial monitor where you need the computer switched on.
We are using the HM2004A LCD. It can be used in analogue mode, thereby requiring more wires and therefore more I/O ports, or in this example, an I2C Module can be soldered on and therefore resulting in only 2 ports being used. For the Arduino Mega 2560, these two ports are SDA (20) & SCL (21).
- The HM2004A can be explained as follows –
- HM – Not sure – possibly to do with the manufacturer i.e. Hitachi
- 20 Characters across
- 04 – 4 lines high
- A – The ‘A’ gives us good info – it means the address of the LCD is 0x3F. This is required for the I2C setup.
Ok, the pic below shows two errors:
- The LCD is a 20×2 and not a 20×4 – Fritzing doesn’t have a 20×4 on its file.
- The four wires from the Arduino do not connect to anything. That is because there is no I2C connector on Fritzing either!