Netduino home hardware projects downloads community

Jump to content

The Netduino forums have been replaced by new forums at This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.


Member Since 18 Jan 2013
Offline Last Active Jun 27 2014 09:25 PM

Topics I've Started

System.IO.Exception Occurs In MCP23008LcdTransferProvider Constructor

31 January 2013 - 10:23 PM

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:



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// 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            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:


home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.