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 10 Dec 2010
Offline Last Active May 31 2012 10:57 AM

Topics I've Started

hardware interrupt

28 January 2011 - 03:35 PM

Get Error "no overload for port_OnInterrupt matches delegate 'Microsoft.Spot.Hardware.NativeEventHandler

using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;
using System.Text;
using System.IO.Ports;

namespace Netduinoser
    public class Program{
        private static SerialPort s1;
        private static string s;
        public static void Main()
            InterruptPort port = new InterruptPort(Cpu.Pin.GPIO_Pin10, false, Port.ResistorMode.PullUp,
            port.OnInterrupt += new NativeEventHandler(port_OnInterrupt);
            s1 = new SerialPort("COM1", 115200, Parity.None,8,StopBits.One);
            s1.DataReceived += new SerialDataReceivedEventHandler(s1_DataReceived);
            s1.Open ();
            byte[] OutBuf=Encoding.UTF8.GetBytes("All right?\r");
            byte[] InBuf=new byte[2];
            byte[] temp2 = new byte[] { 0xFE, 0x01 };//clrs

                s1.Write(OutBuf, 0, OutBuf.Length);
               // s1.Write (temp2, 0, temp2.Length);
               // Debug.Print("OK");



Serial datarecieved event

15 December 2010 - 07:17 PM

Having trouble fireing the serial datareceived event. I use com2 for programming. Then I stop debugging, Use putty on the same port to send characters. The receive event should blink an led. using System; using System.Threading; using Microsoft.SPOT; using Microsoft.SPOT.Hardware; using SecretLabs.NETMF.Hardware; using SecretLabs.NETMF.Hardware.NetduinoMini; using System.Text; using System.IO.Ports; namespace blink { public class Program { public static SerialPort port2 = new SerialPort("COM2", 115200, Parity.None, 8, StopBits.One); public static OutputPort outpt=new OutputPort(Pins.GPIO_PIN_5,false); public static void Main() { port2.Open(); port2.DataReceived += new SerialDataReceivedEventHandler(ReceiveData); Thread.Sleep(Timeout.Infinite); } public static void ReceiveData(object sender, SerialDataReceivedEventArgs e) { outpt.Write(true); Thread.Sleep(500); outpt.Write(false); Thread.Sleep(500); } } }

ttl serial port

10 December 2010 - 07:14 PM

I got the chip running using rs232 port for download. I would like to use the usart for talking to a serial display at the same time. Can this be done? I tried some netduino code. "s1=new(serialports(com1)); " but got an error.

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.