Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Bluetooth based data extraction system

Status
Not open for further replies.

tahertinu

Member level 4
Joined
Jun 11, 2011
Messages
74
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
Ahmedabad
Activity points
1,752
'-----------------------------------------------
' (c) 2012 AVR projects
'--------------------------------------------------------------
' file: Bluetooth.bas
' comport settings: COM1,9600,N,8,1
' device AT M8
' Xtal freq: 11059200 Hz
' Hardware req.: ATmega8 board, RS232 connection with AUBTM-20
' Software: Hyperterminal
'--------------------------------------------------------------
$regfile = "m8def.dat"
$sim

Config Lcd = 16 * 2
Cls
Cursor Off

Dim Name_s As String * 60
Dim X As Integer
Dim Store As String * 60
Dim Name1 As String * 60
Dim Addr1 As String * 60
Dim Name2 As String * 60
Dim Addr2 As String * 60
Dim Firstuuid As String * 30

Dim K As Byte
Dim L As Byte

K = 13
L = 10

Dim S As String * 80

Dim Ar(5) As String * 30

Dim Bcount As Byte
Dim J As Byte
Dim Speed As Integer
Speed = 1000

$crystal = 11059200 'change this value into the value of the Xtal you use.

$baud = 19200
Declare Sub Loop1
Print Chr(k)
Print Chr(l)
Print "LLL"
Print Chr(k)
Print Chr(l)
Input Name_s
Print Name_s
Lcd Name_s

Print Chr(k)
Print Chr(l)
Print "AT+NAME=?"
Print Chr(k)
Print Chr(l)
Input Name_s
Print Name_s
Lcd Name_s

Print Chr(k)
Print Chr(l)
Print "<cr><lf>AT+F<cr><lf>"
Print Chr(k)
Print Chr(l)
Input Name_s
Print Name_s
Lcd Name_s

Print Chr(k)
Print Chr(l)
Print "AT+BAUD="9600 ","0 ","0 ""
Print Chr(k)
Print Chr(l)
Input Name_s
Print Name_s
Lcd Name_s

Print Chr(k)
Print Chr(l)
Print "AT+BPROFILE=1"
Print Chr(k)
Print Chr(l)
Input Name_s
Print Name_s
Lcd Name_s

Print Chr(k)
Print Chr(l)
Print "AT+BSERVICEATTR=1,0,1"
Print Chr(k)
Print Chr(l)
Input Name_s
Print Name_s
Lcd Name_s

Print Chr(k)
Print Chr(l)
Print "AT+BDISCMODE=1,180"
Print Chr(k)
Print Chr(l)
Input Name_s
Print Name_s
Lcd Name_s



Print Chr(k)
Print Chr(l)
Print "AT+MODE=1"
Print Chr(k)
Print Chr(l)
Input Name_s
Print Name_s
Lcd Name_s

Cls
Print Chr(k)
Print Chr(l)
Print "AT+INQ"
Print Chr(k)
Print Chr(l)
Input Name_s
Store = Name_s
Bcount = Split(store , Ar(1) , ",")
For J = 1 To Bcount
Addr1 = Ar(1)
Name1 = Ar(2)
Print Ar(j)
Lcd Addr1
Wait 5
Next

Firstuuid = Right(addr1 , 17)
Print Firstuuid



Print Chr(k)
Print Chr(l)
Print "AT+OPPCON=" ; Firstuuid ; ",8"
Print Chr(k)
Print Chr(l)
Input Name_s
Print Name_s
Lcd Name_s

Print Chr(k)
Print Chr(l)
Print "AT+CON=" ; Firstuuid ; ",2"
Print Chr(k)
Print Chr(l)
Input Name_s
Print Name_s
Lcd Name_s

Print Chr(k)
Print Chr(l)
Print "==="
Print Chr(k)
Print Chr(l)
Input Name_s
Print Name_s
Lcd Name_s


Do
Incr X
Print X
Cls
Lcd X
Wait 5
Loop
End
 

THIS IS MY CODE IN BASCOM AVR. I AM USING ATmega8L MICRO CONTROLLER INTERFACED WITH BLUETOOTH.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top