Hi
I try to connect bluetooth module to my laptop.I get the code from document section like that:
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 Bluetooth_connection
{
public partial class Program
{
void ProgramStarted()
{
bluetooth.SetDeviceName(“Gadgeteer”);
bluetooth.BluetoothStateChanged += new Bluetooth.BluetoothStateChangedHandler(bluetooth_BluetoothStateChanged);
bluetooth.DataReceived += new Bluetooth.DataReceivedHandler(bluetooth_DataReceived);
Gadgeteer.Timer timer = new Gadgeteer.Timer(1000, Gadgeteer.Timer.BehaviorType.RunOnce);
timer.Tick += new Gadgeteer.Timer.TickEventHandler(timer_Tick);
timer.Start();
}
void timer_Tick(Gadgeteer.Timer timer)
{
if (!bluetooth.IsConnected)
bluetooth.ClientMode.EnterPairingMode();
}
void bluetooth_BluetoothStateChanged(Bluetooth sender, Bluetooth.BluetoothState btState)
{
Debug.Print(btState.ToString());
}
void bluetooth_DataReceived(Bluetooth sender, string data)
{
Debug.Print(data);
sender.ClientMode.SendLine(data); //echoes the data back to the device.
}
}
}
But once I was debugging code to fez spider I can’t find bluetooth on my laptop. And there weren’t any error at selection screen output. Are there missing parts in code? has someone have fully code? or can someone help me? I am beginner.
Thank you.