Netduino home hardware projects downloads community

Jump to content


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

Arduino LCD Keypad Shield 16x2 HD44780 compatible LCD

Netduino Plus 2 16x2 HD44780

Best Answer Spammy786, 22 September 2014 - 07:43 AM

Hi Guys

 

Thanks for your prompt reply FourT2, I am starting to understand some of the inputs/outputs now so Thank you. 

Regarding the display, I got it to work by following this post http://forums.netdui...-keypad-shield/

 

I cant get the buttons on the display to work but. Any ideas ?

 

But overall the display is working nicely, Just need the buttons to work now.

Go to the full post


  • Please log in to reply
4 replies to this topic

#1 Spammy786

Spammy786

    Member

  • Members
  • PipPip
  • 26 posts

Posted 19 September 2014 - 10:15 PM

Hi Guys, Great product and great forum, I found most of my solutions just by reading other posts but I cant simply cant get this to work. Please help. So I tried to put a very descriptive title so others can find a solution to this problem easily, Trust me I spent many hours trying to google/youtube a solution but still no luck. I need to get the following display to work with a Netduino Plus 2.

 

Display : Arduino LCD Keypad Shield 16x2 HD44780 http://netram.co.za/...pad-shield.html

 

The display just fits on top of the Netdunio (plugs in), Im unsure of the pins (that's my biggest problem) I have tried many examples and still no luck, I have tried many things, Heres a list of resources I tried.

 

http://microliquidcr...l.codeplex.com/

http://joe.blog.free...-bluetooth.html
http://blog.codeblac...d-with-LCD.aspx
http://10rem.net/blo...th-the-netduino
http://geekswithblog...id_crystal.aspx
http://embedded-lab.com/blog/?p=6392

 

I just want a simple hello world example with this Display connected to the Netduino.

 

Also if somebody as time on there hands, Can yourll please explain the pins (GPI and digital etc etc etc) basically when to use what, I think that's why I cant get this display to work because I don't understand the pins that well.

 

Thanks for your time and effort :)



#2 FourT2

FourT2

    Advanced Member

  • Members
  • PipPipPip
  • 63 posts
  • LocationSeattle, WA

Posted 20 September 2014 - 08:28 AM

Can you provide the code that you are using and what is the problem that you are seeing?

 

I don't have experience with that particular shield but I've used a 16x2 LCD with my Arduino, was actually starting to think about porting some of my code to Netduino. 

 

Regarding pins, I suggest picking up Chris' book on Intro to Netduino, it will provide a good intro to pins, but at the most basic level, you have analog pins that will allow you to read voltages from sensors that vary their output based on conditions (e.g. light, temp), and digital pins that are either high or low (true or false). If you follow existing instructions, it will be pretty clear which pins to use.



#3 Spammy786

Spammy786

    Member

  • Members
  • PipPip
  • 26 posts

Posted 22 September 2014 - 07:43 AM   Best Answer

Hi Guys

 

Thanks for your prompt reply FourT2, I am starting to understand some of the inputs/outputs now so Thank you. 

Regarding the display, I got it to work by following this post http://forums.netdui...-keypad-shield/

 

I cant get the buttons on the display to work but. Any ideas ?

 

But overall the display is working nicely, Just need the buttons to work now.



#4 Spammy786

Spammy786

    Member

  • Members
  • PipPip
  • 26 posts

Posted 23 September 2014 - 09:51 AM

Hi guys
 
Heres my code for the display but it doesnt seem to be working correctly.
 
1. it doesnt write "Line 2" and it doesnt write it to the center of the display
2. the button events are slow and im not sure if this is the correct way to do this button logic, I mean is this an optimized way?
3. when I press a button, the text that im writing must stay displayed and not revert back to the original text, it basically needs to stay in that method, but it defaults back.
 
Heres the code, clearly its not correct but I cant seem to debug this and find the problem. Iv tried so many times and so many different approaches..
 using System;

using System.Net;
using System.Net.Sockets;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;
using MicroLiquidCrystal;
 
namespace DisplayExample
{
    public class Program
    {
        public static void Main()
        {
 
            //Keypad connected to Analog pin 0
            AnalogInput keys = new AnalogInput(AnalogChannels.ANALOG_PIN_A0, 3.3, 0.0, -1);
            //backlight connected to D10
            // create the transfer provider
            // Initialize the library with the numbers of the interface pins
            //PWM backlight = new PWM(Pins.GPIO_PIN_D10);
            var lcdProvider = new GpioLcdTransferProvider(Pins.GPIO_PIN_D8, Pins.GPIO_PIN_D9,
                     Pins.GPIO_PIN_D4, Pins.GPIO_PIN_D5, Pins.GPIO_PIN_D6, Pins.GPIO_PIN_D7);
                     
            // create the LCD interface
            var lcd = new Lcd(lcdProvider);
 
            // set up the number of columns and rows: 
            lcd.Begin(16, 2);
            lcd.Write("Line 1");
            lcd.SetCursorPosition(8, 1);
            lcd.Write("Line 2");
 
            while (true)
            {
                var lcd_key = keys.Read() * 100;
                if (lcd_key.ToString("F0") == "155")
                {
                    lcd.Clear();
                    lcd.Write("Down Button");
                    //it must stay in the below mode until another button is pressed.
                    DoOperation1();
                }
                else if (lcd_key.ToString("F0") == "68")
                {
                    lcd.Clear();
                    lcd.Write("Up Button");
                    //it must stay in the below mode until another button is pressed.
                    DoOperation2();
                }
                else if (lcd_key.ToString("F0") == "0")
                {
                    lcd.Clear();
                    lcd.Write("Right Button");
                }
                else if (lcd_key.ToString("F0") == "238")
                {
                    lcd.Clear();
                    lcd.Write("Left Button");
                }
                else
                {
                    lcd.Clear();
                    lcd.Write("Line 1");
                    lcd.SetCursorPosition(8, 1);
                    lcd.Write("Line 2");
                }
                Thread.Sleep(1000);
            }
            
            public static void DoOperation1()
            {
              //when the down button is pressed, it must remain in this mode until another button
              // is pressed and it must go into that method and stay there
            }
            
            public static void DoOperation2()
            {
              //when the up button is pressed, it must remain in this mode until another button
              // is pressed and it must go into that method and stay there
            }
        }
    }
}
 

Thanks guys.



#5 FourT2

FourT2

    Advanced Member

  • Members
  • PipPipPip
  • 63 posts
  • LocationSeattle, WA

Posted 24 September 2014 - 03:45 AM

I think you need to do this (at least this is what I am doing with a similar LCD in Arduino):
 
// set up the number of columns and rows: 
lcd.Begin(16, 2);
 
// write line 1
lcd.SetCursorPosition(0, 0);
lcd.Write("Line 1");
 
// write line 2
lcd.SetCursorPosition(0, 1);
lcd.Write("Line 2");





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

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.