This will be easy mode for most of you, I have a set of xbee usb wireless moduls. A Net-mini. All I want to do is get some examples of the code to read from my computer to the xbee mods, and turn on an LED on my Net-mini,
Can anyone send we some good links on doing this, I just need full code for the net-Mini, not the PC side of that. Its working good. I can't figure out the code I need to put in the net-Mini to read and execute the LED.
Thanks
NetDuino/xbee code
Started by JWills, Oct 23 2012 02:47 AM
1 reply to this topic
#1
Posted 23 October 2012 - 02:47 AM
#2
Posted 23 October 2012 - 08:24 AM
Hm, the PC-side code and the netduino code should be smiliar.
You need to connect the XBee to netduino's TTL-level serial port.
Open the serial port and listen to the proper bytes on which you want to switch the LED.
You need to connect the XBee to netduino's TTL-level serial port.
Open the serial port and listen to the proper bytes on which you want to switch the LED.
private static SerialPort serialPort; private OutputPort led = new OutputPort(Pins.ONBOARD_LED, false); public static void Main() { serialPort = new SerialPort("COM1", 9600, Parity.None, 8, StopBits.One); serialPort.Open(); serialPort.DataReceived += new SerialDataReceivedEventHandler(serialPort_DataReceived); Thread.Sleep(Timeout.Infinite); } private static void serialPort_DataReceived(object sender, SerialDataReceivedEventArgs e) { // Read the bytes and switch LED led.Write(true); }
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users