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

Serial TTL LCD

netduino ttl serial lcd ba

  • Please log in to reply
3 replies to this topic

#1 vfell

vfell

    New Member

  • Members
  • Pip
  • 2 posts

Posted 29 May 2014 - 01:33 PM

All,

New to NetDuino and also new to C#... just getting back into doing some coding.

Have purchased a Netduino 2 and am wanting to drive a serial LCD.  Example code for Arduino is in link:

 

https://learn.adafru...with-ttl-serial

 

Any pointers would be appreciated!

Vince



#2 Zoot

Zoot

    Advanced Member

  • Members
  • PipPipPip
  • 31 posts

Posted 02 June 2014 - 12:45 AM

Welcome to the forums and congrats on the Netduino purchase.  I don't have time to adapt the code for you (and you won't learn that way, anyway), but I'll try to give you some pointers in the form of pseudo-code:

 

1. For C#, you need to use a namespace and a main class for your program. 

2. There is no "Setup" function like there is on the Arduino.  You need to use methods to define all of the functions that you want to use.

 

Here is a pseudo-code example:

namespace serialLCD     // The namespace
{
     public class LCD     // The class
     {
          public LCD()     // The class constructor
          {
                initSerial();     // Call the initialization code for the serial port
                initLCD();       // Call the initialization code for the LCD
          }

          private void initSerial()
          {
               // Initialization code for the serial port goes here
           }

           private void initLCD()
           {
                // set the size of the display if it isn't 16x2 (you only have to do this once)
                // This is the Arduino code and won't work.  This is here to show you what needs to be done in this method.
                //  The Netduino code will be different

                lcd.write(0xFE);
                lcd.write(0xD1);
                lcd.write(16); // 16 columns
                lcd.write(2); // 2 rows
                delay(10); 
              }

// More methods needed here for brightness, contrast, etc.  You also have to have a main method for the program to call all of this stuff.

If you're serious about learning C#, I recommend a book called "Essential C#" by Mark Michaelis.  It's a fantastic book, and it's one of the only resources you'll ever need for the C# language.

 

I'm sorry that I don't have time to adapt the code for you and show you how it's done, but I can certainly answer any question that you pose in this thread.

 

Hope I helped a little...



#3 wendo

wendo

    Advanced Member

  • Members
  • PipPipPip
  • 85 posts

Posted 02 June 2014 - 03:47 AM

There is a driver for the now discontinued Seeedstudio Grove Serial LCD here that I wrote that may work as a starting point. It doesn't have an RGB backlight like the one you have and will probably need all it's commands changed, but it'll give you framework to start with



#4 vfell

vfell

    New Member

  • Members
  • Pip
  • 2 posts

Posted 02 June 2014 - 02:55 PM

Wow! What great info!! Thank You Both!!  Appreciate your taking the time to respond.  Looking forward to learning and moving forward.

Thanks again,

Vince






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.