* For each guess it will re-initialize the display and
* write the constructor to the serial port.
* It will then attempt to blink the backlight 3 times.
* Finally it will attempt to write the constructor used to the LCD.
* When the correct configuration is guessed,
* the LCD will display the constructor
* and the backlight will be on.
*
* Since the guesser uses a limited number of known permutations,
* it is possible that it will not be able to guess the needed
* wiring.
*
* To use:
* 1. install fm's library (it replaces the stock LiquidCrystal library)
* 2. hookup the i2c backpack and only the i2c backpack to the Arduino
* (make sure to use the needed pullup resistors -
* i2c needs them to work correctly)
* 3. compile and upload the sketch
* 4. go to the serial monitor in the IDE and set the baud rate to 9600 baud
* 5. press the reset button on the arduino to start clean
* 6. Press the <ENTER> key or [Send] button to advance to next guess
* NOTE: Make sure to select a newline as the line ending and
* if using the <ENTER> key you must first click on the text box
* to give it focus.
Serial output:
NOTE/WARNING: Guessing the i2c constructor is not really a
good thing since it could damage the hardware. Use with caution!
Do not leave things with an incorrect guess for too long.
i.e. advance to the next guess as soon as possible
when the guess in incorrect.
If the guess is correct, the constructor will show up
on the LCD.
<Press or click [Send] to Continue>
Scanning i2c bus for devices…
i2c device found at address 0x27
Device found: PCF8574
<Press or click [Send] to start guessing>
Trying: lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE)
<Press or click [Send] to Continue>
Trying: lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, NEGATIVE)
<Press or click [Send] to Continue>
Trying: lcd(0x27, 4, 5, 6, 0, 1, 2, 3, 7, NEGATIVE)
<Press or click [Send] to Continue>
Trying: lcd(0x27, 6, 5, 4, 0, 1, 2, 3, 7, NEGATIVE)
<Press or click [Send] to Continue>
Trying: lcd(0x27, 6, 5, 4, 0, 1, 2, 3, 7, POSITIVE)
<Press or click [Send] to Continue>
Trying: lcd(0x27, 4, 5, 6, 0, 1, 2, 3, 7, POSITIVE)
<Press or click [Send] to Continue>