bluetooth communication module 3. warm up swq: 30 – oct. – 2013 give examples where bluetooth...

27
Bluetooth Communication Module 3

Upload: alexander-foster

Post on 03-Jan-2016

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Bluetooth Communication Module 3. Warm Up SWQ: 30 – Oct. – 2013 Give examples where Bluetooth technology is used What is the range for the Bluetooth ?

Bluetooth Communication

Module 3

Page 2: Bluetooth Communication Module 3. Warm Up SWQ: 30 – Oct. – 2013 Give examples where Bluetooth technology is used What is the range for the Bluetooth ?

Warm Up

• SWQ: 30 – Oct. – 2013

• Give examples where Bluetooth technology is used

• What is the range for the Bluetooth ?

Page 3: Bluetooth Communication Module 3. Warm Up SWQ: 30 – Oct. – 2013 Give examples where Bluetooth technology is used What is the range for the Bluetooth ?

NXT and Bluetooth

Search for projects that uses Bluetooth in the NXT

Page 4: Bluetooth Communication Module 3. Warm Up SWQ: 30 – Oct. – 2013 Give examples where Bluetooth technology is used What is the range for the Bluetooth ?

What blocks I need to build Bluetooth

communication between two NXT ??

Page 5: Bluetooth Communication Module 3. Warm Up SWQ: 30 – Oct. – 2013 Give examples where Bluetooth technology is used What is the range for the Bluetooth ?

Send message block: send a wireless message to another NXT

Receive message block: receive a wireless message from another NXT

Page 6: Bluetooth Communication Module 3. Warm Up SWQ: 30 – Oct. – 2013 Give examples where Bluetooth technology is used What is the range for the Bluetooth ?

Send Message Block

Page 7: Bluetooth Communication Module 3. Warm Up SWQ: 30 – Oct. – 2013 Give examples where Bluetooth technology is used What is the range for the Bluetooth ?

The send message block can be configured using either the configuration panel or using data wires

Connection

Mail Box

text I will send

Number I will send

logic I will send

X = -2 -2

Page 8: Bluetooth Communication Module 3. Warm Up SWQ: 30 – Oct. – 2013 Give examples where Bluetooth technology is used What is the range for the Bluetooth ?

AhmedX = Ahmed

X = 1 1

Page 9: Bluetooth Communication Module 3. Warm Up SWQ: 30 – Oct. – 2013 Give examples where Bluetooth technology is used What is the range for the Bluetooth ?

How can I send the measured sound

level ?

Page 10: Bluetooth Communication Module 3. Warm Up SWQ: 30 – Oct. – 2013 Give examples where Bluetooth technology is used What is the range for the Bluetooth ?

Send Message BlockConnection Connection section is used to identify the connection

number of the target NXT (the NXT that will receive the message). It is a value between 0 and 3.

Message Includes: • message type (logic, number or text)• message content.

Mailbox Each NXT brick has 10 mailbox numbers where wirelessmessages can be stored.

Each mailbox number can hold up to five messages.

Page 11: Bluetooth Communication Module 3. Warm Up SWQ: 30 – Oct. – 2013 Give examples where Bluetooth technology is used What is the range for the Bluetooth ?

Receive Message Block

Page 12: Bluetooth Communication Module 3. Warm Up SWQ: 30 – Oct. – 2013 Give examples where Bluetooth technology is used What is the range for the Bluetooth ?

Mail Box number The test textThe test Number The test logicMessage received (yes/N0)If the test message and received message the same, output is TrueThe received textThe received Number The received logic

The receive message block can be configured using either the configuration panel or using data wires

Page 13: Bluetooth Communication Module 3. Warm Up SWQ: 30 – Oct. – 2013 Give examples where Bluetooth technology is used What is the range for the Bluetooth ?

Receive Message BlockMessage: The message section allows you to select the type of

message being received (logic, number or text).

Compare to: If you want to compare the incoming message with a test message, either type the test text or number or use the radio buttons to choose the logic test value (True or False).

If the test message and the received message are the same, the Yes/No data wire will return a value of “1”; otherwise, it will return a value of “0”.

Mailbox: The mailbox identifies the receiver’s mailbox where the sent message will be stored.

Page 14: Bluetooth Communication Module 3. Warm Up SWQ: 30 – Oct. – 2013 Give examples where Bluetooth technology is used What is the range for the Bluetooth ?

Why do I need to compare between the test message and the received message ?

Page 15: Bluetooth Communication Module 3. Warm Up SWQ: 30 – Oct. – 2013 Give examples where Bluetooth technology is used What is the range for the Bluetooth ?

Correct Communication

• Connection Number on the computer and the chosen one on the NXT must be the same

• Mail box of the transmitter and the receiver must be the same

Page 16: Bluetooth Communication Module 3. Warm Up SWQ: 30 – Oct. – 2013 Give examples where Bluetooth technology is used What is the range for the Bluetooth ?

LAB ACTIVITY 1:

– Step 1: Turn on Bluetooth on both NXT

– Step 2: Rename the NXTs (TX# and RX#)

– Step 3: SEARCH for RX# on the TX# NXT

<> (connection is made)

Page 17: Bluetooth Communication Module 3. Warm Up SWQ: 30 – Oct. – 2013 Give examples where Bluetooth technology is used What is the range for the Bluetooth ?

• Step 5: Receiver Program

• Step 6: Run the program on the receiver first

LAB ACTIVITY 1: (Page 11)

,

Why ??

• Step 4: Sender Program

Page 18: Bluetooth Communication Module 3. Warm Up SWQ: 30 – Oct. – 2013 Give examples where Bluetooth technology is used What is the range for the Bluetooth ?

Worksheet

Page 19: Bluetooth Communication Module 3. Warm Up SWQ: 30 – Oct. – 2013 Give examples where Bluetooth technology is used What is the range for the Bluetooth ?

Connection Number: Mail box Number:Sent massage: Data type of the sent massage:

Page 20: Bluetooth Communication Module 3. Warm Up SWQ: 30 – Oct. – 2013 Give examples where Bluetooth technology is used What is the range for the Bluetooth ?

Connection Number: Mail box Number:Sent massage: Data type of the sent massage:

Page 21: Bluetooth Communication Module 3. Warm Up SWQ: 30 – Oct. – 2013 Give examples where Bluetooth technology is used What is the range for the Bluetooth ?

Connection Number: Mail box Number:Sent massage: Data type of the sent massage:

Page 22: Bluetooth Communication Module 3. Warm Up SWQ: 30 – Oct. – 2013 Give examples where Bluetooth technology is used What is the range for the Bluetooth ?

Connection Number: Mail box Number:Sent massage: Data type of the sent massage:

Page 23: Bluetooth Communication Module 3. Warm Up SWQ: 30 – Oct. – 2013 Give examples where Bluetooth technology is used What is the range for the Bluetooth ?

Review Exercise – Page 17

• Sender Program:• The sender unit will read the sound level• The sender will display the sound level values on its

screen and send them wirelessly to a receiver unit

• Receiver Program:• The receiver unit will receive the sound level values.• If the sound level values are more than 50%, the

receiver unit will move forward; otherwise, it will stop moving.

Page 24: Bluetooth Communication Module 3. Warm Up SWQ: 30 – Oct. – 2013 Give examples where Bluetooth technology is used What is the range for the Bluetooth ?

LAB ACTIVITY 2:Remote Control Program

Page 25: Bluetooth Communication Module 3. Warm Up SWQ: 30 – Oct. – 2013 Give examples where Bluetooth technology is used What is the range for the Bluetooth ?

LAB ACTIVITY 2: Car Program

This looks confusing ??!!

Read it step by step, it will be

easy

Page 26: Bluetooth Communication Module 3. Warm Up SWQ: 30 – Oct. – 2013 Give examples where Bluetooth technology is used What is the range for the Bluetooth ?

Recap

Page 27: Bluetooth Communication Module 3. Warm Up SWQ: 30 – Oct. – 2013 Give examples where Bluetooth technology is used What is the range for the Bluetooth ?

Conclusion

• Send massage block • Receive massage block • Set up the Bluetooth on both NXTs• Sender program• Receiver Program