public static void Main()
        {
            var setup = new BaseShifterLcdTransferProvider.ShifterSetup
            {
                BL     = ShifterPin.GP7,
                RS     = ShifterPin.GP1,
                RW     = ShifterPin.None,
                Enable = ShifterPin.GP2,
                D4     = ShifterPin.GP6,
                D5     = ShifterPin.GP5,
                D6     = ShifterPin.GP4,
                D7     = ShifterPin.GP3
            };
            var lcdBus = new Shifter74Hc595LcdTransferProvider(SPI.SPI_module.SPI1, Pins.GPIO_PIN_D3,
                                                               Shifter74Hc595LcdTransferProvider.BitOrder.MSBFirst,
                                                               setup);
            var lcd = new Lcd(lcdBus);

            lcd.Begin(16, 2);
            lcd.Write("Hello, world!");
            while (true)
            {
                lcd.SetCursorPosition(0, 1);
                lcd.Write((Utility.GetMachineTime().Ticks / 10000).ToString());
                Microsoft.SPOT.Debug.Print("here");
                Thread.Sleep(100);
            }
        }
        public static void Main()
        {
            Debug.Print("Application started OK.");

            Debug.Print("Initialising the display");
            var setup = new BaseShifterLcdTransferProvider.ShifterSetup()
            {
                BL     = ShifterPin.GP7,
                RS     = ShifterPin.GP1,
                RW     = ShifterPin.None,
                Enable = ShifterPin.GP2,
                D4     = ShifterPin.GP6,
                D5     = ShifterPin.GP5,
                D6     = ShifterPin.GP4,
                D7     = ShifterPin.GP3
            };

            Debug.Print("Shifter setup correctly.");

            var lcdBus = new Shifter74Hc595LcdTransferProvider(SPI.SPI_module.SPI1, Pins.GPIO_PIN_D3,
                                                               Shifter74Hc595LcdTransferProvider.BitOrder.MSBFirst, setup);

            Debug.Print("LCD Bus created.");

            var lcd = new Lcd(lcdBus);

            Debug.Print("LCD Created");

            lcd.Begin(16, 2);
            Debug.Print("Starting the application loop.");
            lcd.Write("Hello, world!");
            int count = 0;

            while (true)
            {
                count++;
                Debug.Print("Pass: " + count.ToString());
                lcd.SetCursorPosition(0, 1);
                lcd.Write((Utility.GetMachineTime().Ticks / 10000).ToString());
                Thread.Sleep(100);
            }
        }
Exemple #3
0
        public LCD()
        {
            //Switched to shift register solution on 5/31/2011
            //var lcdProvider = new GpioLcdTransferProvider(
            //    Pins.GPIO_PIN_D12,  // RS
            //    Pins.GPIO_NONE,     // RW
            //    Pins.GPIO_PIN_D11,  // enable
            //    Pins.GPIO_PIN_D9,   // d0
            //    Pins.GPIO_PIN_D8,   // d1
            //    Pins.GPIO_PIN_D7,   // d2
            //    Pins.GPIO_PIN_D6,   // d3
            //    Pins.GPIO_PIN_D5,   // d4
            //    Pins.GPIO_PIN_D4,   // d5
            //    Pins.GPIO_PIN_D3,   // d6
            //    Pins.GPIO_PIN_D2);  // d7

            var lcdProvider = new Shifter74Hc595LcdTransferProvider(SPI_Devices.SPI1, SecretLabs.NETMF.Hardware.NetduinoPlus.Pins.GPIO_PIN_D10);

            // create the LCD interface
            lcd = new Lcd(lcdProvider);

            // set up the number of columns and rows:
            lcd.Begin(16, 2);
        }