Bluetooth

Una vez conectandonos con Putty o TeraTerm ,

Hay 2 modos de operarlo, en los primeros DATA y COMMAND, el primero es automatico, el segundo solo se puede invocar en los primeros 60 segundos de cuando se conecte (GREEN LED)
Para acceder como modo commando debemos de Tecleamos $$$  (tres veces signo de pesos)
Password por default es 1234



Este es el menú del área de comandos,


$$$     inmediatamente al ponerlo entra modo comando
CMD

*** SET COMMANDS ***
SA,<1,0>   - Authentication
SB,<num>   - Send Break
SC,<hex>   - Service Class
SD,<hex>   - Device Class
SE,<1,0>   - Encryption
SF,1       - Factory Defaults
SI,<hex>   - Inquiry Scan Window
SJ,<hex>   - Page Scan Window
SL,<E,O,N> - Parity
SM,<0-5>   - Mode (0=slav,1=mstr,2=trig,3=auto,4=DTR,5=Any)
SN,<name>  - Name
SO,<text>  - conn/discon Status
SP,<text>  - Pin Code
SR,<adr>   - Remote Address
SS,<text>  - Service Name
ST,<num>   - Config Timer
SU,<rate>  - Baudrate
SW,<hex>   - Sniff Rate
SX,<1,0>   - Bonding
SY,<hex>   - TX power
SZ,<num>   - Raw Baudrate
S7,<0-1>   - 7bit data
S~,<0-3>   - Profile (0=SPP,1=DCE,2=DTE,3=MDM,4=D&S
S?,<0-1>   - role switch
S$,<char>  - CMD mode char
S@,<hex>   - io port dir
S&,<hex>   - io port val
S%,<hex>   - io boot dir
S^,<hex>   - io boot val
S*,<hex>   - pio(8-11) set
S|,<hex>   - low power timers
*** DISPLAY      ***
D     - Basic Settings
E     - Extended Settings
G<X>  - Stored setting
GB    - BT Address
GK    - Connect Status
G&    - I/O Ports
V     - Firmare version
*** OTHER        ***
C,<adr>    - Connect
F,1        - Fast Mode
I,<time>,<cod> - Device Scan Inquiry
K,         - Kill (disconnect)
L,         - toggle local echo
P,<text>   - Pass Thru
Q          - Quiet (no discovery)
R,1        - Reboot
T,<0,1>    - send data in CMD mode
U,<rate>,<E,O,N> - Temp Uart Change
Z          - low power sleep
&          - Read switches
***Settings***
BTA=000666031669
BTName=ArduinoBT
Baudrt(SW4)=115K
Parity=None
Mode  =Slav
Authen=0
Encryp=0
PinCod=1234
Bonded=0
Rem=NONE SET
?
***ADVANCED Settings***
SrvName= SPP
SrvClass=0000
DevClass=1F00
InqWindw=0100
PagWindw=0100
CfgTimer=60
?batuStr=NULL
000666031669
ERR
24
END
H






Programa presionas 1, enciendo el led de pin 13, y le das cero, lo apaga.

/*
simple LED test
*/

char val;         // variable to receive data from the serial port
int ledpin = 2;  // LED connected to pin 2 (on-board LED)

void setup()
{
  pinMode(ledpin = 13, OUTPUT);  // pin 13 (on-board LED) as OUTPUT
 
  Serial.begin(115200);       // start serial communication at 115200bps
 
}
 
void loop() {
  if( Serial.available() )       // if data is available to read
  {;}
    val = Serial.read();         // read it and store it in 'val'
 
  if( val == '0' )               // if '0' was received led 13 is switched off

  {
   digitalWrite(ledpin, LOW);    // turn Off pin 13 off
delay(1000);                  // waits for a second 
Serial.println("13 off");
  }

if( val == '1' )               // if '1' was received led 13 on
 {
    digitalWrite(ledpin = 13, HIGH);  // turn ON pin 13 on
    delay(1000);                  // waits for a second
    Serial.println("13 on");
  }
}
Ċ
Rene Solis,
2 mar 2011 19:41
Ċ
Erik Samario,
10 mar 2011 18:57
Ċ
Rene Solis,
2 mar 2011 19:44
Ċ
Rene Solis,
2 mar 2011 19:44
Ċ
Rene Solis,
22 mar 2011 19:48
Comments