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.

waxie

Member Since 09 Aug 2011
Offline Last Active Sep 12 2011 02:51 PM
-----

Topics I've Started

Help with Serial LCD displaying gobbly-de-gop!

01 September 2011 - 06:08 AM

Hi there,

I was wondering if someone could help me with my Serial LCD display. I am a newbie using the Netduino and I have brought this Serial LCD display and have followed the instructions here but for some reason when I run my sample application i just get rubbish sent to the display.

I have wired the display into the 5V and ground pins and for the data port I have wired it to digital Input 0.
I have not touched the sample code provided but here it is for full clarity.

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.NetduinoPlus;
using Bansky.SPOT.LCD;

namespace NetduinoPlusApplicationLCDDisplay
{
    public class Program
    {
        public static void Main()
        {
            // Create instance of shift register
            HC4094 shifter = new HC4094(Pins.GPIO_PIN_D0, 	// Data pin
                                          Pins.GPIO_PIN_A5, 	// Clock pin
                                          Pins.GPIO_PIN_A4,	// Strobe pin
                                          true);               // Little Endian

            // Create new LCD instance and use shift register as a transport layer
            LCD4Bit lcd = new LCD4Bit(shifter);

            // Creating custom characters (Smiley face and gimp)
            byte[] buffer = new byte[] {    0x07, 0x08, 0x10, 0x10, 0x13, 0x13, 0x10, 0x10,
                                            0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04,
                                            0x1C, 0x02, 0x01, 0x01, 0x19, 0x19, 0x01, 0x01,
                                            0x10, 0x10, 0x12, 0x11, 0x10, 0x10, 0x08, 0x07,
                                            0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x1F,
                                            0x01, 0x01, 0x09, 0x11, 0x01, 0x01, 0x02, 0x1C,

                                            0x15, 0x15, 0x0E, 0x04, 0x04, 0x0A, 0x11, 0x11,
                                            0x04, 0x04, 0x0E, 0x15, 0x04, 0x0A, 0x11, 0x11
                                       };

            // Load custom characters to display CGRAM
            lcd.WriteToCGRAM(0x00, buffer);

            // Turn displat on, turn back light on, hide small cursor, show big blinking cursor
            lcd.Display(true, true, false, true);

            lcd.Clear();
            lcd.Write("Start me up!");
            Thread.Sleep(3000);

            lcd.Clear();
            lcd.Display(true, true, false, false);

            // Print the special characters with the face
            lcd.Write(new byte[] { 0x00, 0x01, 0x02 }, 0, 3);
            lcd.Write(" .NET Micro");

            // Move to second line
            lcd.SetPosition(40);

            // Print the special characters with the face
            lcd.Write(new byte[] { 0x03, 0x04, 0x05 }, 0, 3);
            lcd.Write("  Framework");
            Thread.Sleep(2000);

            // Blink with back light
            for (int i = 0; i < 4; i++)
            {
                lcd.Display(true, ((i % 2) != 0), false, false);
                Thread.Sleep(400);
            }

            lcd.Clear();
            string message = "* Hello World! *";
            // Let gimp write the message
            for (int i = 0; i < message.Length; i++)
            {
                lcd.SetPosition(i + 40);
                lcd.WriteByte((byte)(((i % 2) == 0) ? 0x06 : 0x07));

                lcd.SetPosition(i);
                lcd.Write(message[i].ToString());

                Thread.Sleep(200);

                lcd.SetPosition(i + 40);
                lcd.Write(" ");
            }
            Thread.Sleep(1500);

            lcd.Clear();
            lcd.SetPosition(16);

            lcd.Write("http://bansky.net/blog");
            // Scroll the page url
            while (true)
            {
                lcd.ShiftDisplay(false);
                Thread.Sleep(400);
            }


        }

    }
}


Beginner needs Help with Netduino & PIR Motion Detection!

28 August 2011 - 08:36 AM

Hello All, I am hoping someone will be able to help me with my problem here. I am a beginner and am trying to wire up a PIR Motion sensor but am not having any luck at all.. I have attached pictures of my code and my wiring setup of the Netduino and PIR sensor for info. Here is my problem: In my code I have set up an interupt port so that it tells me when the voltage changes and I have set it up to digital input port 0. When it detects movement I was expecting the "port_OnInterrupt" function to be called but I am getting nothing!!!! I have even tried putting a breakpoint in there but am getting nothing! I have absolutly no experience with electrics so I am wondering if I have wired the sensor up wrong in some way. I have wired the red wire of the PIR to the 5V pin on the netduino. I have wired the black wire of the PIR to the Gnd pin on the netduino I have wired the brown wire of the PIR to the Digital Input port 0 pin on the netduino. As I understand it when it detects movement it sends a signal down the brown wire which is why I was expecting a change of signal in my code on the Digital Input port 0. Any help with this would be greatly appreciated. Thanks

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.