Forum >Replies by drewmon79
userhead drewmon79
Replies (4)
  • You Reply: Okay, in my devices under Generic Bluetooth Adapter I
    disabled:
    Bluetooth Device (Personal Area Network)
    Microsoft Bluetooth Enumerator

    I left the following enabled:
    Generic Bluetooth Adapter
    Bluetooth Device (RFCOMM Protocol TDI)

    and now I have two-way serial bluetooth communications using Putty. Arduino IDE still doesn't recognize COM6 when bluetooth is paired.

    The only other thing I'd really like to get working for now is code upload.

    My Win7 has a command called Bluetooth File Transfer that sends and receives files. This works for my Android phone, but does not work for this Bluetooth module.

    When I click send I just get "Bluetooth Transfer not completed" which is not helpful. Is there a way to transfer files with Putty? or any ideas on what could make this work?
  • You Reply: I noticed that the bluetooth requires a 9600 baud rate, but the version of this code posted on the Romeo wiki uses a 19200 baud rate for USB serial communication. Does this change in my code to accomodate bluetooth matter?
  • You Reply: I tried the serial.print("Hello World") test with the Arduino IDE  and had no success with the serial monitor. Win7 detects the bluetooth device on COM6 and I set the serial port to COM 6 when it's not gray. I retried several times with no success.

    I downloaded a free version of Hyperterminal, but could not connect. Then I downloaded PuTTY and that worked, I got the Hello World transmissions.

    So next I tried a simple program to transmit commands from the pc keyboard to the Romeo. However, this didn't work. The Romeo reacts to the commands but not in the correct way. This code doesn't send anything to digital pin 9 or 10 but some servos that are connected move when I type "w". According to the code, the dc motors connected t pins 4-7 are supposed to move. (This hardware has been tested and works without bluetooth) When I right click the mouse the motors toggle forward/backward a few times.

    Here's the code that I'm using:

    //Standard PWM DC control

    int E1 = 5;    //M1 Speed Control
    int E2 = 6;    //M2 Speed Control
    int M1 = 4;    //M1 Direction Control
    int M2 = 7;    //M1 Direction Control



    void stop(void)                    //Stop
            {
              digitalWrite(E1,LOW); 
              digitalWrite(E2,LOW);     
            } 
    void advance(char a,char b)          //Move forward
            {
              analogWrite (E1,a);      //PWM Speed Control
              digitalWrite(M1,HIGH);   
              analogWrite (E2,b);   
              digitalWrite(M2,HIGH);
            } 
    void back_off (char a,char b)          //Move backward
            {
              analogWrite (E1,a);
              digitalWrite(M1,LOW); 
              analogWrite (E2,b);   
              digitalWrite(M2,LOW);
    }
    void turn_L (char a,char b)            //Turn Left
            {
              analogWrite (E1,a);
              digitalWrite(M1,LOW);   
              analogWrite (E2,b);   
              digitalWrite(M2,HIGH);
            }
    void turn_R (char a,char b)            //Turn Right
            {
              analogWrite (E1,a);
              digitalWrite(M1,HIGH);   
              analogWrite (E2,b);   
              digitalWrite(M2,LOW);
            }
    void setup(void)
    {
        int i;
        for(i=4;i<=7;i++)
        pinMode(i, OUTPUT); 
        Serial.begin(9600);      //Set Baud Rate
    }
    void loop(void)
    {
        char val = Serial.read();
        if(val!=-1)
          {
              switch(val)
              {
                case 'w'://Move Forward
                        advance (100,100);  //PWM Speed Control
                        break;
                case 's'://Move Backward
                        back_off (100,100);
                        break;
                case 'a'://Turn Left
                        turn_L (100,100);
                        break;     
                case 'd'://Turn Right
                        turn_R (100,100);
                        break;         
                }   
              delay(40);
          }
          else stop(); 
    }

    Any ideas on what could be wrong with the bluetooth transmitted key commands?
  • You Reply: The hardware detected by my laptop is called "Bluetooth_V3"
    The Hardware device function name is "Standard Serial over Bluetooth link (COM 6)".
    The type is "Ports (COM & LPT)"
    The location is "on Bluetooth Device (RFCOMM Protocol TDI)
    It uses "Serial port (SPP) 'Dev B' ... COM6" bluetooth services
    The connection has been authenticated and it states that the device is working properly.
    The Port Settings are: 9600 bps; 8 data bits; parity: none; stop bits 1; flow control: none
    The drier provider is Microsoft, version 6.1.7600.16385 dated 6/21/2006

    I'm running Windows 7 (64 bit).

    If there's any other information that would be useful, let me know.