Thanks, good to know.
- Netduino Forums
- → monsterhunter445's Content
monsterhunter445's Content
There have been 2 items by monsterhunter445 (Search limited from 10-May 23)
#44708 System.IO.Exception Occurs In MCP23008LcdTransferProvider Constructor
Posted by monsterhunter445 on 01 February 2013 - 02:07 PM in Netduino Plus 2 (and Netduino Plus 1)
#44689 System.IO.Exception Occurs In MCP23008LcdTransferProvider Constructor
Posted by monsterhunter445 on 31 January 2013 - 10:23 PM in Netduino Plus 2 (and Netduino Plus 1)
Hello everyone, I am new to Netduino, I have already done a few things like the blinking LED and light sensor (using photoresistor). When I purchased my Netduino Plus 2, I purchased a SainSmart IIC/I2C/TWI Serial 2004 20x4 LCD Module Shield For Arduino UNO MEGA R3. I assume it is compatible with my Netduino Plus 2. Anyway a link to the LCD will be given below, along with the source code. When I try to print Hello World using the Micro Liquid Crystal library, I get nothing on the screen, And an exception occurs in the constructor of the LCD provider. I have no idea what to do and I do not think it is an address issue since I have tried 0x3F (0011 1111) and 0x27 (0010 0111) but nothing changes. I know the LCD works because it is being powered up and I believe it requires 5V to power it up and not 3.3V. I will try to so my setup when I can.
How I set it up:
GND <-> GND
VCC <-> 5V
SDA <-> A4
SCL <-> A5
I also put a resistor on A4 and A5 but to no avail. I will be posting a picture soon. I ran this code:
// Micro Liquid Crystal Library// http://microliquidcrystal.codeplex.com// Appache License Version 2.0 using System.Threading;using MicroLiquidCrystal;using Microsoft.SPOT.Hardware;using SecretLabs.NETMF.Hardware.Netduino;using FusionWare.SPOT.Hardware;namespace HelloWorld{ public class Program { public static void Main() { // create the transfer provider, use direct GPIO provider // Initialize the library with the numbers of the interface pins // Use wiring shown here http://arduino.cc/en/uploads/Tutorial/lcd_schem.png var bus = new I2CBus(); var lcdProvider = new MCP23008LcdTransferProvider(bus, 0x27, MCP23008LcdTransferProvider.DefaultSetup); // create the LCD interface var lcd = new Lcd(lcdProvider); // set up the LCD's number of columns and rows: lcd.Begin(20, 2); // print a message to the LCD. lcd.Write("Hello world!"); while (true) { lcd.Backlight = true; // set the cursor to the first column on the second line lcd.SetCursorPosition(0, 1); // print the number of milliseconds since reset: lcd.Write((Utility.GetMachineTime().Ticks / 10000).ToString()); Thread.Sleep(100); lcd.Backlight = false; //} } } }}
If anybody can help it me it would be appreciated because I am new to electronics but I am pretty good at programming. Thanks in advanced.
External Links:
http://www.sainsmart...no-mega-r3.html
}
- Netduino Forums
- → monsterhunter445's Content
- Privacy Policy