You can use one of the USB-To-Serial adapters that you can connect to you PC and Serial Port on Cerberus. After that it would be trivial to communicate via Virtual COM Port on PC and UART on Cerberus.
Sorry for not answering as fast as you guys…
Yeah i wanted to use an USB-Serial adapter and a Xbee-WiFi adapter.
I looked a bit in the codesharing topic but haven’t found anything…
@ Mike I don’t really know what you mean with “tranparent or API mode” (sorry I’m a really newbie )
@ GermanDude - I have not used a XBee WiFi module yet. I don’t know if there is the equivalent of transparent and API modes. Get the user manual for the WiFi module, and it will tell you how to control it. I believe the interface if a UART (SerialPort).
For the code button, I mean that in your previous message code is unformatted. You should edit your message and put code marker with the “code” button of forum.
For your code, you have configure your serial port.
Now, you can open it and send data:
just for everyone else who maybe wants to know it… that’s what my program finally look like
using System;
using System.Collections;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Presentation;
using Microsoft.SPOT.Presentation.Controls;
using Microsoft.SPOT.Presentation.Media;
using Microsoft.SPOT.Presentation.Shapes;
using Microsoft.SPOT.Touch;
using Gadgeteer.Networking;
using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;
using Gadgeteer.Modules.GHIElectronics;
namespace GadgeteerApp1
{
public partial class Program
{
GT.Timer timer = new GT.Timer(1000);
// This method is run when the mainboard is powered up or reset.
int i = 0;
void ProgramStarted()
{
/*******************************************************************************************
Modules added in the Program.gadgeteer designer view are used by typing
their name followed by a period, e.g. button. or camera.
Many modules generate useful events. Type +=<tab><tab> to add a handler to an event, e.g.:
button.ButtonPressed +=<tab><tab>
If you want to do something periodically, use a GT.Timer and handle its Tick event, e.g.:
GT.Timer timer = new GT.Timer(1000); // every second (1000ms)
timer.Tick +=<tab><tab>
timer.Start();
*******************************************************************************************/
// Use Debug.Print to show messages in Visual Studio's "Output" window during debugging.
Debug.Print("Program Started");
usbSerial.Configure(9600, GT.Interfaces.Serial.SerialParity.None, GT.Interfaces.Serial.SerialStopBits.One, 8);
Mainboard.SetDebugLED(on: true);
Thread.Sleep(300);
Mainboard.SetDebugLED(on: false);
Thread.Sleep(200);
timer.Tick += timer_Tick;
timer.Start();
}
void timer_Tick(GT.Timer timer)
{
if (joystick.IsPressed)
{
i++;
Mainboard.SetDebugLED(on: true);
usbSerial.SerialLine.Open();
usbSerial.SerialLine.Write("Button Pressed "+ i +" time(s) ");
usbSerial.SerialLine.Flush();
}
else
Mainboard.SetDebugLED(on: false);
}
}
}