Main Site Documentation

I can't find gadgeteer bluetooth on my laptop


#1

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.


#2

Hi,
there were problems with the original driver of the bluetooth module.
There are two other driver in the Code Share section that can be used:

One of VBDaniel (I did not yet get the time to try it)
https://www.ghielectronics.com/community/codeshare/entry/867

and my Code Share contribution:
https://www.ghielectronics.com/community/codeshare/entry/763

perhaps you can get some useful information in these links:
https://www.ghielectronics.com/community/forum/topic?id=14770&page=1
https://www.ghielectronics.com/community/forum/topic?id=14615&page=1

Cheers
Roland


#3

@ RoSchmi - Thank you for answer.I’m going to try.


#4

@ RoSchmi - Hi
I tried but there were problem about 'public GTI.Serial serialPort;'
Like picture:


#5

That simply means you haven’t included references you need. Add Gadgeteer.Serial as a reference and you should eliminate those.


#6

@ Brett - Thank you for answer.But where I have to add Gadgeteer.Serial.I am sorry i am new and struggle with this problems. I added it above like picture


#7

Hi,
There


#8

@ RoSchmi - Thank you