(edit sidebar)
Intro to Physical Computing Syllabus

Research & Learning

Other Class pages

Shop Admin

ITP Help Pages
Tom's pcomp site
DanO's pcomp site


Bluetooth

Labs.Bluetooth History

Hide minor edits - Show changes to output

Changed lines 89-90 from:
We'll use a photocell here as an example of a way to get interesting data in to then sound out wirelessly via Bluetooth.  Hook up the photocell like you do any other analog input sensor, similar to the FSRs in the [[http://itp.nyu.edu/physcomp/Labs/AnalogIn | Analog In lab].
to:
We'll use a photocell here as an example of a way to get interesting data in to then sound out wirelessly via Bluetooth.  Hook up the photocell like you do any other analog input sensor, similar to the FSRs in the [[http://itp.nyu.edu/physcomp/Labs/AnalogIn | Analog In lab]].
Deleted lines 66-79:
To list serial ports in Processing, use this code:

(:div class=code :)
(:source  lang=arduino  tabwidth=4:)

//Processing Code
import processing.serial.*;

void setup() {
//list all the available serial ports
println(Serial.list());
}
(:sourceend:)

Changed lines 125-129 from:
Start your Processing sketch and type in following code:

(:source lang=processing tabwidth=4
:)
//Processing Code
:
to:
Start your Processing sketch and type in following code to list available serial ports:

(
:div class=code :)
(:source  lang=arduino  tabwidth=4:)

//Processing Code
Changed lines 133-136 from:
 void setup() {
  size(200, 200);
 //list all the available serial
ports
 println(Serial.list());
to:
void setup() {
//list all the available serial ports
println(Serial.list());
Deleted line 136:
Changed lines 143-144 from:
After figuring out your port number, type in this code in your processing sketch:
to:
Look for the port that has tty and firefly in it, and note the number for the following example code:
Changed lines 146-147 from:
to:
//Processing code
Changed line 157 from:
  //replace the 8 in the next line with the correct serial port number from the list above.  115200 is the data rate associated with this Bluetooth module
to:
  //replace the 8 in the next line with your serial port number from the list above. 
Changed line 159 from:
  myPort = new Serial(this, portName, 115200);
to:
  myPort = new Serial(this, portName, 115200); //115200 is the data rate associated with this Bluetooth module
Added lines 61-64:

void loop() {
//
}
Changed lines 48-49 from:
First, plug your FTDI chip to your LilyPad. 
to:
First, plug your FTDI board into your LilyPad. 
Changed lines 52-53 from:
The first time you use the Bluetooth Mate with your laptop, you need to introduce them to each other by using pairing.  Once your computer has made contact with the Bluetooth module, you can connect to it like any other serial port.  To list serial ports in Processing, use this code:
to:
The first time you use the Bluetooth Mate with your laptop, you need to introduce them to each other by using pairing.  Once your computer has made contact with the Bluetooth module, you can connect to it like any other serial port.  After choosing your board and serial port as usual, upload your code to your Lily Pad Arduino.
Deleted line 54:
Changed line 59 from:
 Serial.begin(115200);
to:
 Serial.begin(115200); //The Bluetooth Mate has a baud rate of 115200, faster than the 9600 we're used to.
Changed lines 61-67 from:
to:
(:sourceend:)

To list serial ports in Processing, use this code:

(:div class=code :)
(:source  lang=arduino  tabwidth=4:)

Deleted line 74:
Deleted lines 76-77:
The Bluetooth Mate has a baud rate of 115200, faster than the 9600 we're used to.  After choosing your board and serial port as usual, upload your code to your Lily Pad Arduino.
Changed lines 94-95 from:
For Windows 7 users, click on the "Show Hidden Icons" icon in the taskbar to get to the "Bluetooth Devices". Click the "Bluetooth Devices Icon" and from the menu, choose "Open Settings". In the "Settings" window, choose the "Options" pane, and make sure that you've allowed other devices to find this computer, and that you've allowed them to connect as well. Then click the "COM ports" pane. If you've paired with you Bluetooth module before, there will be two ports indicated for it, one outgoing and one incoming. You're not using those though, because Windows tries to initiate contact when you do. You want the Bluetooth modem to initiate contact. Add a new incoming port. Note the port number, then open that port in your serial terminal program at 115200 bps
to:
For Windows 7 users, click on the "Show Hidden Icons" icon in the taskbar to get to the "Bluetooth Devices". Click the "Bluetooth Devices Icon" and from the menu, choose "Open Settings". In the "Settings" window, choose the "Options" pane, and make sure that you've allowed other devices to find this computer, and that you've allowed them to connect as well. Then click the "COM ports" pane. If you've paired with you Bluetooth module before, there will be two ports indicated for it, one outgoing and one incoming. You're not using those though, because Windows tries to initiate contact when you do. You want the Bluetooth modem to initiate contact. Add a new incoming port. Note the port number, then open that port in your serial terminal program at 115200 bps.
Changed lines 97-100 from:
!!Attach a Photocell
to:
!!Add a Photocell

We'll use a photocell here as an example of a way to get interesting data in to then sound out wirelessly via Bluetooth.  Hook up the photocell like you do any other analog input sensor, similar to the FSRs in the [[http://itp.nyu.edu/physcomp/Labs/AnalogIn | Analog In lab].

Deleted line 104:
Changed lines 108-109 from:
Now, plug in your FTDI board again, and program your Lily Pad Arduino with following code:
to:
Now, plug in your FTDI board again, and program your Lily Pad Arduino with the following code:
Added lines 111-112:
//Arduino Code:
Changed lines 128-129 from:
Test this code with the FTDI board on, and try to see if you are receiving any values on your serial monitor.  Then you can switch to your Bluetooth device and battery.
to:
Test this code with the FTDI board on, and try to see if you are receiving any values on the Arduino serial monitor.  Then you can switch to your Bluetooth device and battery.
Changed lines 138-139 from:
to:
//Processing Code:
Changed lines 154-155 from:
 After figuring out your port number, type in this code in your processing sketch:
to:
After figuring out your port number, type in this code in your processing sketch:
Changed line 167 from:
  //replace the # in the next line with the correct serial port number from the list above.  115200 is the data rate associated with this Bluetooth module
to:
  //replace the 8 in the next line with the correct serial port number from the list above.  115200 is the data rate associated with this Bluetooth module
Changed line 175 from:
   String myString = myPort.readStringUntil('\n');  //reads serial port untill end of line
to:
   String myString = myPort.readStringUntil('\n');  //reads serial port until end of line
Added lines 91-93:
!!Pair Bluetooth and Laptop  (Windows 7)
For Windows 7 users, click on the "Show Hidden Icons" icon in the taskbar to get to the "Bluetooth Devices". Click the "Bluetooth Devices Icon" and from the menu, choose "Open Settings". In the "Settings" window, choose the "Options" pane, and make sure that you've allowed other devices to find this computer, and that you've allowed them to connect as well. Then click the "COM ports" pane. If you've paired with you Bluetooth module before, there will be two ports indicated for it, one outgoing and one incoming. You're not using those though, because Windows tries to initiate contact when you do. You want the Bluetooth modem to initiate contact. Add a new incoming port. Note the port number, then open that port in your serial terminal program at 115200 bps

Changed lines 99-101 from:
!!Pair Bluetooth and Laptop  (Windows 7)
For Windows 7 users, click on the "Show Hidden Icons" icon in the taskbar to get to the "Bluetooth Devices". Click the "Bluetooth Devices Icon" and from the menu, choose "Open Settings". In the "Settings" window, choose the "Options" pane, and make sure that you've allowed other devices to find this computer, and that you've allowed them to connect as well. Then click the "COM ports" pane. If you've paired with you Bluetooth module before, there will be two ports indicated for it, one outgoing and one incoming. You're not using those though, because Windows tries to initiate contact when you do. You want the Bluetooth modem to initiate contact. Add a new incoming port. Note the port number, then open that port in your serial terminal program at 115200 bps

to:

Changed lines 3-10 from:
  There are a few methods of wireless serial communication:

''Infrared (IR)''.  This is how television remotes work.  IR transmitters send bits using pulses of infrared light and require a line of sight between the transmitter and receiver. 

''Radio/RF''.  This is how garage door openers work.  RF transmitters send bits on pulses of radio energy.  RF doesn’t require a line of sight but can be blocked by large metal objects.  In order to differentiate the signal from other ambient radio or light waves, the data is sent on a carrier wave.  If the receiver detects data at a carrier wave it’s listening for, it knows to read the data, and if it doesn’t, then it knows nothing is being sent.  The actual information is encoded by slightly varying the frequency of the carrier wave (called frequency modulation, or FM) or its signal strength (called amplitude modulation, or AM) to indicate a logic 0 or 1.  There are many different types of wireless serial communication. This tutorial focuses on Bluetooth serial communication.

''Bluetooth''' is a high-speed RF communication protocol intended for connection between various mobile devices.  The high speeds allow it to carry rich data like digitized audio and video.  Once two devices make contact over a Bluetooth connection, the radios handle error correction, noise, and crosstalk for you.  Its range is limited to about 10m (but some claim up to 100m!).  It is primarily designed for one-to-one connections, and once two devices are connected they ignore all other Bluetooth devices nearby until the connection is broken.
to:
There are a few methods of wireless serial communication:

''Infrared (IR)''\\
This is how television remotes
work.  IR transmitters send bits using pulses of infrared light and require a line of sight between the transmitter and receiver. 

''Radio/RF''\\
This is how garage door openers
work.  RF transmitters send bits on pulses of radio energy.  RF doesn’t require a line of sight but can be blocked by large metal objects.  In order to differentiate the signal from other ambient radio or light waves, the data is sent on a carrier wave.  If the receiver detects data at a carrier wave it’s listening for, it knows to read the data, and if it doesn’t, then it knows nothing is being sent.  The actual information is encoded by slightly varying the frequency of the carrier wave (called frequency modulation, or FM) or its signal strength (called amplitude modulation, or AM) to indicate a logic 0 or 1.  There are many different types of wireless serial communication. This tutorial focuses on Bluetooth serial communication.

''Bluetooth'' is a high-speed RF communication protocol intended for connection between various mobile devices.  The high speeds allow it to carry rich data like digitized audio and video.  Once two devices make contact over a Bluetooth connection, the radios handle error correction, noise, and crosstalk for you.  Its range is limited to about 10m (but some claim up to 100m!).  It is primarily designed for one-to-one connections, and once two devices are connected they ignore all other Bluetooth devices nearby until the connection is broken.
Changed lines 5-16 from:
# Infrared (IR).  This is how television remotes work.  IR transmitters send bits using pulses of infrared light and require a line of sight between the transmitter and receiver. 

# Radio/RF.  This is how garage door openers work.  RF transmitters send bits on pulses of radio energy.  RF doesn’t require a line of sight but can be blocked by large metal objects.  In order to differentiate the signal from other ambient radio or light waves, the data is sent on a carrier wave.  If the receiver detects data at a carrier wave it’s listening for, it knows to read the data, and if it doesn’t, then it knows nothing is being sent.  The actual information is encoded by slightly varying the frequency of the carrier wave (called frequency modulation, or FM) or its signal strength (called amplitude modulation, or AM) to indicate a logic 0 or 1.  There are a few different flavors of radio we can use...

## Wireless Ethernet (Wi-Fi)

## Xbees

##
Bluetooth.  A subset of RF, it’s a high-speed RF multilayer communication protocol intended for connection between various mobile devices.  The high speeds allow it to carry rich data like digitized audio and video.  It’s useful to us because once two devices make contact over a Bluetooth connection, the radios handle error correction, noise, and crosstalk for you.  Its range is limited to about 10m (but some claim up to 100m!).  It is primarily designed for one to one connections, and once two devices are connected they ignore all other Bluetooth devices nearby until the connection is broken.

Bluetooth devices can be considered modems because they convert electrical
signals (TTL serial carried over wires) into Bluetooth serial carried over radio signals and back.  A modem is a device that converts one type of signal into another, and connects one object to one other object.  Your home cable/DSL modem is one example - it takes the digital data from your home computer, converts it to a signal that can be carried across the cable line, and connects to another modem on the other end.  That modem is connected to your ISP’s network.  All modems are designed to open a connection to another modem, negotiate the terms of data exchange, carry on an exchange, then disconnect. To do this, they have to have two operating modes, usually referred to as '''command mode''', in which you talk to the modem, and '''data mode''', in which you talk through the modem.    Like modems, Bluetooth serial devices have two modes: command mode and data mode.
to:
''Infrared (IR)''.  This is how television remotes work.  IR transmitters send bits using pulses of infrared light and require a line of sight between the transmitter and receiver. 

''Radio/RF''.  This is how garage door openers work.  RF transmitters send bits on pulses of radio energy.  RF doesn’t require a line of sight but can be blocked by large metal objects.  In order to differentiate the signal from other ambient radio or light waves, the data is sent on a carrier wave.  If the receiver detects data at a carrier wave it’s listening for, it knows to read the data, and if it doesn’t, then it knows nothing is being sent.  The actual information is encoded by slightly varying the frequency of the carrier wave (called frequency modulation, or FM) or its signal strength (called amplitude modulation, or AM) to indicate a logic 0 or 1.  There are many different types of wireless serial communication. This tutorial focuses on Bluetooth serial communication.

''Bluetooth''' is a high-speed
RF communication protocol intended for connection between various mobile devices.  The high speeds allow it to carry rich data like digitized audio and video.  Once two devices make contact over a Bluetooth connection, the radios handle error correction, noise, and crosstalk for you.  Its range is limited to about 10m (but some claim up to 100m!).  It is primarily designed for one-to-one connections, and once two devices are connected they ignore all other Bluetooth devices nearby until the connection is broken.

Bluetooth devices can be considered modems because they convert electrical signals (TTL serial carried over wires) into Bluetooth serial carried over radio
signals and back.  A '''modem''' is a device that converts one type of signal into another, and connects one object to one other object.  Your home cable/DSL modem is one example - it takes the digital data from your home computer, converts it to a signal that can be carried across the cable line, and connects to another modem on the other end.  That modem is connected to your ISP’s network.  All modems are designed to open a connection to another modem, negotiate the terms of data exchange, carry on an exchange, then disconnect. To do this, they have to have two operating modes, usually referred to as '''command mode''', in which you talk to the modem, and '''data mode''', in which you talk through the modem.    Like modems, Bluetooth serial devices have two modes: command mode and data mode.
Changed lines 14-25 from:
- Get the device’s address
- Tell the device to scan for other devices
- Connect to a given address
- Disconnect from a given address
- Enter or leave command mode

In order to use Bluetooth for physical computing, you’ll need a Bluetooth serial module.  The one we’ll use here is [[http://www.sparkfun.com/commerce/product_info.php?products_id=9358 | Sparkfun’s Bluetooth Mate]].  If you’re communicating from one microcontroller to the other, you’ll need two Bluetooth modules.  Otherwise, you can use your laptop with a Bluetooth receiver (many have them built in, but if yours doesn’t, you can buy a Bluetooth adaptor).  The Bluetooth Mate has two interfaces: two of its pins, marked RX and TX, are an asynchronous serial port that can communicate with a microcontroller. It also has a radio that communicates using the Bluetooth communications protocol. It acts as a modem, translating between the Bluetooth and regular asynchronous serial protocols. 

Since Bluetooth can carry many other protocols, you’ll need to tell your computer that you want to make a serial connection.  On a PC or Mac with Bluetooth built in, you’ll run some utility to establish a new serial port.  If you have an adapter, you’ll be able to define a new serial port after installing the drivers according to the radio’s instructions. 

Most Bluetooth modems use something called the Hayes AT command protocol which is all done in ASCII characters.  To switch from data mode to command mode, send the string +++.  To switch from command mode to data mode, send ---.  This Bluetooth module doesn’t officially use AT commands, but the protocol is similar.  To switch
from data mode to command mode, send the string $$$.  To exit command mode, send the string ---\r (the \r is a carriage return, ASCII 13), and the Bluetooth modem switches back to data mode.
to:
* Get the device’s address
* Tell the device to scan for other devices
* Connect to a given address
* Disconnect from a given address
* Enter or leave command mode

In order to use Bluetooth for physical computing, you’ll need a Bluetooth serial module.  The one you'll use here is [[http://www.sparkfun.com/commerce/product_info.php?products_id=9358 | Sparkfun’s Bluetooth Mate]].  If you’re communicating from one microcontroller to the other, you’ll need two Bluetooth modules.  Otherwise, you can use your laptop with a Bluetooth receiver (many have them built in, but if yours doesn’t, you can buy a Bluetooth adapter).  The Bluetooth Mate has two interfaces: two of its pins, marked RX and TX, are an asynchronous serial port that can communicate with a microcontroller. It also has a radio that communicates using the Bluetooth communications protocol. It acts as a modem, translating between the Bluetooth and regular asynchronous serial protocols. 

Bluetooth can carry many other services besides serial data, but this device can only carry serial data.  To use it, you’ll need to tell your computer that you want to make a serial connection.  On a PC or Mac with Bluetooth built in, you’ll establish and configure the serial connection using the Bluetooth control panel.  If you have an adapter, you’ll be able to define a new serial port after installing the drivers according to the radio’s instructions. 

To switch the Bluetooth Mate
from data mode to command mode, send the string $$$.  To exit command mode, send the string ---\r (the \r is a carriage return, ASCII 13), and the Bluetooth modem switches back to data mode.
Changed lines 3-4 from:
Look Ma, No Wires!  The easiest wireless communication typically takes output from an existing serial protocol, like RS-232, and sends it over a wireless connection.  In theory, this means the cables disappear but the code stays just about the same.  There are a few methods of wireless serial communication:
to:
  There are a few methods of wireless serial communication:
Added line 60:
//Arduino code
Deleted lines 62-64:

//list all the available serial ports
println(Serial.list());
Added lines 65-72:
//Processing Code
import processing.serial.*;

void setup() {
//list all the available serial ports
println(Serial.list());
}

Added line 105:
Changed lines 117-118 from:
'''Attention:''' If you are not using call and response method, you should put a delay at the end of your code. Otherwise Bluetooth locks itself. Unlocking is possible, however we don't want that for now.
to:
'''Attention:''' If you are not using call and response method, you should put a delay at the end of your code. Otherwise, because of data overflowing, Bluetooth locks itself. Unlocking is possible, however we don't want that for now.
Changed lines 92-94 from:
!!Pair Bluetooth and Laptop  (MAC OS)

to:
!!Pair Bluetooth and Laptop  (Windows 7)
For Windows 7 users, click on the "Show Hidden Icons" icon in the taskbar to get to the "Bluetooth Devices". Click the "Bluetooth Devices Icon" and from the menu, choose "Open Settings". In the "Settings" window, choose the "Options" pane, and make sure that you've allowed other devices to find this computer, and that you've allowed them to connect as well. Then click the "COM ports" pane. If you've paired with you Bluetooth module before, there will be two ports indicated for it, one outgoing and one incoming. You're not using those though, because Windows tries to initiate contact when you do. You want the Bluetooth modem to initiate contact. Add a new incoming port. Note the port number, then open that port in your serial terminal program at 115200 bps
Changed lines 48-49 from:
!!Pair Bluetooth and Laptop
to:
!!Pair Bluetooth and Laptop  (MAC OS)
Added lines 92-95:
!!Pair Bluetooth and Laptop  (MAC OS)


(:table:)
Changed lines 48-51 from:
!!Pair Bluetooth and Laptop
The first time you use the Bluetooth Mate with your laptop, you need to introduce them to each other by using pairing.

Fist, plug your FTDI chip to your LilyPad. 
to:
!!Pair Bluetooth and Laptop

First, plug your FTDI chip to your LilyPad. 

Changed lines 54-55 from:
Once your computer has made contact with the Bluetooth module, you can connect to it like any other serial port.  To list serial ports in Processing, use this code:
to:
The first time you use the Bluetooth Mate with your laptop, you need to introduce them to each other by using pairing.  Once your computer has made contact with the Bluetooth module, you can connect to it like any other serial port.  To list serial ports in Processing, use this code:
Changed lines 69-72 from:
The Bluetooth Mate has a baud rate of 115200, faster than the 9600 we're used to.

After choosing your board and serial port as usual, upload your code to your Lily Pad Arduino.
to:
The Bluetooth Mate has a baud rate of 115200, faster than the 9600 we're used to.  After choosing your board and serial port as usual, upload your code to your Lily Pad Arduino.
Changed lines 77-78 from:
Your machine will start searching for Bluetooth devices around you. Your Bluetooth device will be "FireFly-xxxx".  It will show up as the port called FireFly-XXX-SPP.  Once you know the port number, you can put the following lines in the setup function:
to:
Your machine will start searching for Bluetooth devices around you. Your Bluetooth device will be "FireFly-xxxx".  It will show up as the port called FireFly-XXX-SPP. 
Added line 80:
Added line 82:
Changed line 88 from:
!!!Attach a Photocell
to:
!!Attach a Photocell
Changed lines 111-114 from:
Test this code with FTDI board on, and try to see if you are receiving any values on your serial monitor.

Now
you can switch to your Bluetooth device and battery.
to:
Test this code with the FTDI board on, and try to see if you are receiving any values on your serial monitor.  Then you can switch to your Bluetooth device and battery.
Changed lines 136-137 from:
My device is using "port 8" on my laptop. After figuring out your port number, type in these codes in your processing sketch:
to:
 After figuring out your port number, type in this code in your processing sketch:
Changed line 150 from:
  String portName = Serial.list()[8];
to:
  String portName = Serial.list()[8]; //My device is using "port 8" on my laptop
Deleted line 174:
Added line 180:
Changed lines 5-17 from:
#) Infrared (IR).  This is how television remotes work.  IR transmitters send bits using pulses of infrared light and require a line of sight between the transmitter and receiver. 

#) Radio/RF.  This is how garage door openers work.  RF transmitters send bits on pulses of radio energy.  RF doesn’t require a line of sight but can be blocked by large metal objects.  In order to differentiate the signal from other ambient radio or light waves, the data is sent on a carrier wave.  If the receiver detects data at a carrier wave it’s listening for, it knows to read the data, and if it doesn’t, then it knows nothing is being sent.  The actual information is encoded by slightly varying the frequency of the carrier wave (called frequency modulation, or FM) or its signal strength (called amplitude modulation, or AM) to indicate a logic 0 or 1.  There are a few different flavors of radio we can use...

##) Wireless Ethernet (Wi-Fi)

##) Xbees

##) Bluetooth.  A subset of RF, it’s a high-speed RF multilayer communication protocol intended for connection between various mobile devices.  The high speeds allow it to carry rich data like digitized audio and video.  It’s useful to us because once two devices make contact over a Bluetooth connection, the radios handle error correction, noise, and crosstalk for you.  Its range is limited to about 10m (but some claim up to 100m!), so it’s not useful for long-range wireless.  It is primarily designed for one to one connections, and once two devices are connected they ignore all other Bluetooth devices nearby until the connection is broken.

A modem is a device that converts one type of signal into another, and connects one object to one other object.  Your home cable/DSL modem is
one example - it takes the digital data from your home computer, converts it to a signal that can be carried across the cable line, and connects to another modem on the other end.  That modem is connected to your ISP’s network.  All modems are designed to open a connection to another modem, negotiate the terms of data exchange, carry on an exchange, then disconnect. To do this, they have to have two operating modes, usually referred to as command mode, in which you talk to the modem, and data
mode, in which you talk through the modem.  Bluetooth devices can be considered modems because they convert electrical signals (TTL serial carried over wires) into Bluetooth serial carried over radio signals and back.
  Like modems, Bluetooth serial devices have two modes: command mode and data mode.
to:
# Infrared (IR).  This is how television remotes work.  IR transmitters send bits using pulses of infrared light and require a line of sight between the transmitter and receiver. 

# Radio/RF.  This is how garage door openers work.  RF transmitters send bits on pulses of radio energy.  RF doesn’t require a line of sight but can be blocked by large metal objects.  In order to differentiate the signal from other ambient radio or light waves, the data is sent on a carrier wave.  If the receiver detects data at a carrier wave it’s listening for, it knows to read the data, and if it doesn’t, then it knows nothing is being sent.  The actual information is encoded by slightly varying the frequency of the carrier wave (called frequency modulation, or FM) or its signal strength (called amplitude modulation, or AM) to indicate a logic 0 or 1.  There are a few different flavors of radio we can use...

## Wireless Ethernet (Wi-Fi)

## Xbees

## Bluetooth.  A subset of RF, it’s a high-speed RF multilayer communication protocol intended for connection between various mobile devices.  The high speeds allow it to carry rich data like digitized audio and video.  It’s useful to us because once two devices make contact over a Bluetooth connection, the radios handle error correction, noise, and crosstalk for you.  Its range is limited to about 10m (but some claim up to 100m!).  It is primarily designed for one to one connections, and once two devices are connected they ignore all other Bluetooth devices nearby until the connection is broken.

Bluetooth
devices can be considered modems because they convert electrical signals (TTL serial carried over wires) into Bluetooth serial carried over radio signals and back.  A modem is a device that converts one type of signal into another, and connects one object to one other object.  Your home cable/DSL modem is one example - it takes the digital data from your home computer, converts it to a signal that can be carried across the cable line, and connects to another modem on the other end.  That modem is connected to your ISP’s network.  All modems are designed to open a connection to another modem, negotiate the terms of data exchange, carry on an exchange, then disconnect. To do this, they have to have two operating modes, usually referred to as '''command mode''', in which you talk to the modem, and '''data mode''', in which you talk through the modem.   Like modems, Bluetooth serial devices have two modes: command mode and data mode.
Changed lines 24-27 from:
In order to use Bluetooth for physical computing, you’ll need a Bluetooth serial module.  The one we’ll use here is Sparkfun’s Bluetooth mate:
http://www.sparkfun.com/commerce/product_info.php?products_id=9358
If you’re communicating from one microcontroller to the other, you’ll need two Bluetooth modules.  Otherwise, you can use your laptop with a Bluetooth receiver (many have them built in, but if yours doesn’t, you can buy a Bluetooth adaptor).  This module has two interfaces: two of its pins, marked RX and TX, are an asynchronous serial port that can communicate with a microcontroller. It also has a radio that communicates using the Bluetooth communications protocol. It acts as a modem, translating between the Bluetooth and regular asynchronous serial protocols. 
to:
In order to use Bluetooth for physical computing, you’ll need a Bluetooth serial module.  The one we’ll use here is [[http://www.sparkfun.com/commerce/product_info.php?products_id=9358 | Sparkfun’s Bluetooth Mate]].  If you’re communicating from one microcontroller to the other, you’ll need two Bluetooth modules.  Otherwise, you can use your laptop with a Bluetooth receiver (many have them built in, but if yours doesn’t, you can buy a Bluetooth adaptor).  The Bluetooth Mate has two interfaces: two of its pins, marked RX and TX, are an asynchronous serial port that can communicate with a microcontroller. It also has a radio that communicates using the Bluetooth communications protocol. It acts as a modem, translating between the Bluetooth and regular asynchronous serial protocols. 
Deleted lines 27-35:
Once your computer has made contact with the Bluetooth module, you can connect to it like any other serial port.  To list serial ports in Processing, use this line of code in the setup portion of the sketch:
//lost all the available serial ports
println(Serial.list());   

It will show up as the port called FireFly-XXX-SPP.  Once you know the port number, you can put the following lines in the setup function:

//replace the # in the next line with the correct serial port number from the list.  115200 is the data rate associated with this Bluetooth module
myPort = new Serial(this, Serial.list[#], 115200);

Changed lines 54-55 from:
Then start programing your Lily Pad with the following code:
to:
Once your computer has made contact with the Bluetooth module, you can connect to it like any other serial port.  To list serial ports in Processing, use this code:
Deleted line 59:
Added lines 63-64:
//list all the available serial ports
println(Serial.list());
Deleted lines 66-71:
 void loop() {
}
void setup() {
 Serial.begin(115200);

}
Changed lines 69-73 from:
The Bluetooth Mate has a baud rate of 115200, faster than the 9600 we're used to. After choosing your board and serial port, upload your code to your Lily Pad.

After uploading your sketch, you can unplug FTDI board and plug in bluetooth mate,
and lithium battery. Start LED on bluetooth mate should start blinking. Bluetooth mate's pins are matching with Lily Pad's, so don't worry about the connection.

Now Turn on your bluetooth
settings and choose "Set Up Bluetooth Device" option.
to:
The Bluetooth Mate has a baud rate of 115200, faster than the 9600 we're used to.

After choosing your board and serial port as usual, upload your code to your Lily Pad Arduino.

After uploading your sketch, you can unplug the FTDI board
and plug in the Bluetooth Mate and lithium battery. The start LED on the Bluetooth Mate should start blinking.  The pins on the Bluetooth Mate match with the Lily Pad's, so don't worry about the connection.

Mac Users:
Now Turn on your Bluetooth
settings and choose "Set Up Bluetooth Device" option.
Changed lines 79-80 from:
Then, your machine will start searching for Bluetooth devices around you. Your Bluetooth device will be "FireFly-xxxx".
to:
Your machine will start searching for Bluetooth devices around you. Your Bluetooth device will be "FireFly-xxxx".  It will show up as the port called FireFly-XXX-SPP.  Once you know the port number, you can put the following lines in the setup function:
Changed line 94 from:
Now, plug in your FTDI board again, and program your Lily Pad, with following code:
to:
Now, plug in your FTDI board again, and program your Lily Pad Arduino with following code:
Deleted line 98:
Deleted line 100:
Changed lines 113-116 from:
Now you can switch to your bluetooth device and battery.

'''Attention:''' If you are not using call and response method, you should put a delay at the end of your code. Otherwise bluetooth locks itself. Unlocking is possible, however we don't want that for now.
to:
Now you can switch to your Bluetooth device and battery.

'''Attention:''' If you are not using call and response method, you should put a delay at the end of your code. Otherwise Bluetooth locks itself. Unlocking is possible, however we don't want that for now.
Deleted lines 125-127:
void setup()
{

Added line 128:
 //list all the available serial ports
Changed lines 150-152 from:
  // I know that the first port in the serial list on my mac
  // is always my  FTDI adaptor, so I open Serial.list()[8].
  println(Serial.list());
to:
  println(Serial.list());  //list all the available serial ports
  //replace
the # in the next line with the correct serial port number from the list above.  115200 is the data rate associated with this Bluetooth module
Changed line 159 from:
   String myString = myPort.readStringUntil('\n');//reads serial port untill end of line
to:
   String myString = myPort.readStringUntil('\n');  //reads serial port untill end of line
Deleted lines 174-175:
@]
Changed lines 185-186 from:
Also, take a look in to "Connect" LED on your Bluetooth, it should turn on and stay like this, as soon as you have establish a connection between bluetooth and your laptop.
to:
Also, take a look at the "Connect" LED on your Bluetooth Mate - it should turn on and stay on as soon as you have established a connection between Bluetooth and your laptop.
Changed lines 2-3 from:
In this lab, you'll learn how to how to use bluetooth mate, bluetooth module with Arduino Lily Pad. You will be able to receive serial values through bluetooth to  processing, wirelessly.
to:

Look Ma, No Wires!  The easiest wireless communication typically takes output from an existing serial protocol, like RS-232, and sends it over a wireless connection.  In theory, this means the cables disappear but the code stays just about the same.  There are a few methods of wireless serial communication:

#) Infrared (IR).  This is how television remotes work.  IR transmitters send bits using pulses of infrared light and require a line of sight between the transmitter and receiver. 

#) Radio/RF.  This is how garage door openers work.  RF transmitters send bits on pulses of radio energy.  RF doesn’t require a line of sight but can be blocked by large metal objects.  In order to differentiate the signal from other ambient radio or light waves, the data is sent on a carrier wave.  If the receiver detects data at a carrier wave it’s listening for, it knows to read the data, and if it doesn’t, then it knows nothing is being sent.  The actual information is encoded by slightly varying the frequency of the carrier wave (called frequency modulation, or FM) or its signal strength (called amplitude modulation, or AM) to indicate a logic 0 or 1.  There are a few different flavors of radio we can use...

##) Wireless Ethernet (Wi-Fi)

##) Xbees

##) Bluetooth.  A subset of RF, it’s a high-speed RF multilayer communication protocol intended for connection between various mobile devices.  The high speeds allow it to carry rich data like digitized audio and video.  It’s useful to us because once two devices make contact over a Bluetooth connection, the radios handle error correction, noise, and crosstalk for you.  Its range is limited to about 10m (but some claim up to 100m!), so it’s not useful for long-range wireless.  It is primarily designed for one to one connections, and once two devices are connected they ignore all other Bluetooth devices nearby until the connection is broken.

A modem is a device that converts one type of signal into another, and connects one object to one other object.  Your home cable/DSL modem is one example - it takes the digital data from your home computer, converts it to a signal that can be carried across the cable line, and connects to another modem on the other end.  That modem is connected to your ISP’s network.  All modems are designed to open a connection to another modem, negotiate the terms of data exchange, carry on an exchange, then disconnect. To do this, they have to have two operating modes, usually referred to as command mode, in which you talk to the modem, and data
mode, in which you talk through the modem.  Bluetooth devices can be considered modems because they convert electrical signals (TTL serial carried over wires) into Bluetooth serial carried over radio signals and back.  Like modems, Bluetooth serial devices have two modes: command mode and data mode.

A Bluetooth radio has a unique address that other devices can use to identify it.  To begin communication, the radio scans the area around it.  If it discovers other devices, it can request a connection and begin conversing.  Different modules have different commands, but in general you can:
- Get the device’s address
- Tell the device to scan for other devices
- Connect to a given address
- Disconnect from a given address
- Enter or leave command mode

In order to use Bluetooth for physical computing, you’ll need a Bluetooth serial module.  The one we’ll use here is Sparkfun’s Bluetooth mate:
http://www.sparkfun.com/commerce/product_info.php?products_id=9358
If you’re communicating from one microcontroller to the other, you’ll need two Bluetooth modules.  Otherwise, you can use your laptop with a Bluetooth receiver (many have them built in, but if yours doesn’t, you can buy a Bluetooth adaptor).  This module has two interfaces: two of its pins, marked RX and TX, are an asynchronous serial port that can communicate with a microcontroller. It also has a radio that communicates using the Bluetooth communications protocol. It acts as a modem, translating between the Bluetooth and regular asynchronous serial protocols. 

Since Bluetooth can carry many other protocols, you’ll need to tell your computer that you want to make a serial connection.  On a PC or Mac with Bluetooth built in, you’ll run some utility to establish a new serial port.  If you have an adapter, you’ll be able to define a new serial port after installing the drivers according to the radio’s instructions. 

Once your computer has made contact with the Bluetooth module, you can connect to it like any other serial port.  To list serial ports in Processing, use this line of code in the setup portion of the sketch:
//lost all the available serial ports
println(Serial.list());   

It will show up as the port called FireFly-XXX-SPP.  Once you know the port number, you can put the following lines in the setup function:

//replace the # in the next line with the correct serial port number from the list.  115200 is the data rate associated with this Bluetooth module
myPort = new Serial(this, Serial.list[#], 115200);

Most Bluetooth modems use something called the Hayes AT command protocol which is all done in ASCII characters.  To switch from data mode to command mode, send the string +++.  To switch from command mode to data mode, send ---.  This Bluetooth module doesn’t officially use AT commands, but the protocol is similar.  To switch from data mode to command mode, send the string $$$.  To exit command mode, send the string ---\r (the \r is a carriage return, ASCII 13), and the Bluetooth modem switches back to data mode.

In this lab, you'll learn how to how to use a Bluetooth Mate with a Lily Pad Arduino. You will be able to receive serial values through Bluetooth to Processing wirelessly.

Changed line 1 from:
'''Bluetooth Lab'''
to:
!!!Overview
Changed lines 6-7 from:
!!! Parts
to:
!! Parts
Changed lines 20-23 from:
!!!Pair Bluetooth and Laptop
First time we use the bluetooth mate with our laptop, we need to introduce them to each other by using pairing.

Plug your FTDI chip to your LilyPad, first
to:
!!Pair Bluetooth and Laptop
The first time you use the Bluetooth Mate with your laptop, you need to introduce them to each other by using pairing.

Fist, plug your FTDI chip to your LilyPad. 
Changed line 39 from:
(void setup() {
to:
void setup() {
Changed lines 44-45 from:
Bluetooth mate are coming as their boud rate pre programmed, which is "115200". After choosing your board and serial port, upload your code to your Lily Pad.
to:

The
Bluetooth Mate has a baud rate of 115200, faster than the 9600 we're used to. After choosing your board and serial port, upload your code to your Lily Pad.
Changed lines 52-53 from:
Then, your machine will start searching for bluetooth devices around you. Your bluetooth device will be "FireFly-xxxx".
to:
Then, your machine will start searching for Bluetooth devices around you. Your Bluetooth device will be "FireFly-xxxx".
Changed line 55 from:
Afther double clicking your device, laptop will try to pair with bluetooth. It is going to ask you to enter "0000". However, since we are not using a keyboard device, we need to go to "Passcode Options" and click "Do not use passcode with this device".
to:
After double clicking your device, laptop will try to pair with bluetooth. It is going to ask you to enter "0000". However, since we are not using a keyboard device, we need to go to "Passcode Options" and click "Do not use passcode with this device".
Changed lines 65-66 from:
!!!Program your Lily Pad
to:
!!Program your Lily Pad
Changed lines 93-94 from:
!!!Program your Processing Sketch
to:
!!Program your Processing Sketch
Changed lines 11-12 from:
%lframe width=100px valign=center%[[Attach:lillypad_li.jpg|Attach:lillypad_li.jpg"Lily Pad LiPower"]] | [-Lily Pad Arduino LiPower-]
%lframe width=100px valign=center%[[Attach:bluemate.jpg|Attach:bluemate.jpg"Bluetooth mate"]] | [-Bluetooth mate-]
to:
%lframe width=100px valign=center%[[Attach:lillypad_li.jpg|Attach:lillypad_li.jpg"Lily Pad LiPower"]] | [-LilyPad Arduino Simple Board-]
%lframe width=100px valign=center%[[Attach:bluemate.jpg|Attach:bluemate.jpg"Bluetooth mate"]] | [-Bluetooth Mate-]
Changed line 11 from:
%lframe width=100px valign=center%[[Attach:lillypad_li.jpg|Attach:lillypad_li.jpg"Lily Pad Arduino LiPower"]] | [-Lily Pad LiPower-]
to:
%lframe width=100px valign=center%[[Attach:lillypad_li.jpg|Attach:lillypad_li.jpg"Lily Pad LiPower"]] | [-Lily Pad Arduino LiPower-]
Changed line 11 from:
%lframe width=100px valign=center%[[Attach:lillypad_li.jpg|Attach:lillypad_li.jpg"Lily Pad LiPower"]] | [-Lily Pad LiPower-]
to:
%lframe width=100px valign=center%[[Attach:lillypad_li.jpg|Attach:lillypad_li.jpg"Lily Pad Arduino LiPower"]] | [-Lily Pad LiPower-]
Changed lines 116-117 from:
[@
to:
(:source lang=processing tabwidth=4 :)
Changed lines 154-156 from:
to:
(:sourceend:)

Changed line 72 from:
 void '''setup'''() {
to:
 void setup() {
Changed line 77 from:
 void '''loop'''() {
to:
 void loop() {
Changed lines 96-97 from:
[@
to:
(:source lang=processing tabwidth=4 :)
Changed lines 108-109 from:
@]
to:
(:sourceend:)
Changed lines 67-69 from:
(:div class=code :)
 %color=#cc6600%int%% photocellPin = 0;    %color=#7e7e7e%// Analog input pin that the photocell is attached to
 %color=#cc6600%int%% val = 0;  %color=#7e7e7e%// value read from the analog sensor
to:
(:source lang=arduino tabwidth=4 :)
 int photocellPin = 0;    // Analog input pin that the photocell is attached to
 int val = 0;  // value read from the analog sensor
Changed lines 72-74 from:
 %color=#cc6600%void%% %color=#cc6600%'''setup'''%%() {
%color=#cc6600% Serial.begin%%(115200);
to:
 void '''setup'''() {
 Serial.begin(115200);
Changed line 77 from:
 %color=#cc6600%void%% %color=#cc6600%'''loop'''%%() {
to:
 void '''loop'''() {
Changed lines 79-81 from:
 %color=#cc6600%  Serial.println%%(val);
 %color=#cc6600%  Serial.flush%%();
 %color=#cc6600%  delay%%(200);
to:
   Serial.println(val);
  Serial.flush();
  delay(200);
Changed lines 83-84 from:
(:divend:)
to:
(:sourceend:)
Changed lines 28-30 from:
 %color=#cc6600%void%% %color=#cc6600%'''setup'''%%() {
%color=#cc6600% Serial.begin%%(115200);
to:

(:source  lang=arduino  tabwidth=4:)


void
setup() {
 Serial.begin(115200);
Changed line 37 from:
 %color=#cc6600%void%% %color=#cc6600%'''loop'''%%() {
to:
 void loop() {
Changed lines 39-43 from:
(:divend:)
to:
(void setup() {
 Serial.begin(115200);

}
(:sourceend
:)
Changed lines 109-110 from:
mport processing.serial.*;
to:
import processing.serial.*;
Deleted lines 104-105:
Also, take a look in to "Connect" LED on your Bluetooth, it should turn on and stay like this, as soon as you have establish a connection between bluetooth and your laptop.
Added lines 153-154:
Also, take a look in to "Connect" LED on your Bluetooth, it should turn on and stay like this, as soon as you have establish a connection between bluetooth and your laptop.
Changed lines 101-106 from:
When you first run this code, you will see a screen like this:

%width=600 alt='Bluetooth Pairing Code' align=top valign=center%[[Attach:bt_code.jpg|Attach:bt_code.jpg]]

You need to type in "1234" as your passcode. After clicking "Pair"
, you should see values like this:
to:
When you run this code, you should see values like this:
Changed lines 147-152 from:
According to your sensor values, you will be able to see color changes on your rectangle.
to:

When you first run this code, you will see a screen like this:

%width=600 alt='Bluetooth Pairing Code' align=top valign=center%[[Attach:bt_code.jpg|Attach:bt_code.jpg]]

You need to type in "1234" as your passcode. After clicking "Pair", according
to your sensor values, you will be able to see color changes on your rectangle.
Added lines 52-55:
!!!Attach a Photocell
%width=600 alt='Attach your sensors' align=top valign=center%[[Attach:lily_circuit.jpg|Attach:lily_circuit.jpg]]

(:table:)
Changed lines 51-53 from:
to:
(:table:)
!!!Program your Lily Pad

Added lines 79-81:
(:table:)
!!!Program your Processing Sketch

Changed lines 79-81 from:
(:div class=code :)
%color=#cc6600%import%%
processing.serial.*;
to:
[@
import
processing.serial.*;
Changed lines 85-87 from:
 %color=#cc6600%void%% %color=#cc6600%'''setup'''%%() {
  %color=#cc6600%size%%(200, 200);
  %color=#cc6600%println%%(Serial.%color=#cc6600%list%%());
to:
 void setup() {
  size(200, 200);
 println(Serial.list());
Changed lines 90-97 from:
(:divend:)
to:
@]

When you first run this code, you will see a screen like this
: 

%width=600 alt='Bluetooth Pairing Code' align=top valign=center%[[Attach
:bt_code.jpg|Attach:bt_code.jpg]]

You need to type in "1234" as your passcode. After clicking "Pair", you should see values like this:

Changed lines 100-144 from:
serials.jpg
to:
Also, take a look in to "Connect" LED on your Bluetooth, it should turn on and stay like this, as soon as you have establish a connection between bluetooth and your laptop.

My device is using "port 8" on my laptop. After figuring out your port number, type in these codes in your processing sketch:

[@

mport processing.serial.*;

Serial myPort;  // Create object from Serial class
int val;      // Data received from the serial port

void setup()
{
  size(200, 200);
  // I know that the first port in the serial list on my mac
  // is always my  FTDI adaptor, so I open Serial.list()[8].
  println(Serial.list());
  String portName = Serial.list()[8];
  myPort = new Serial(this, portName, 115200);
}

void draw()
{
  if ( myPort.available() > 0) {  // If data is available,
    String myString = myPort.readStringUntil('\n');//reads serial port untill end of line
    if (myString != null) { //checks if myString is null
      myString = trim(myString);
      val = int(myString);  //converts string to integer
      background(255);            // Set background to white
      if (val < 150) {              // If the serial value is 0,
        fill(0);                  // set fill to black
      }
      else {                      // If the serial value is not 0,
        fill(204);                // set fill to light gray
      }
      rect(50, 50, 100, 100);
    }
  }
}

@]

According to your sensor values, you will be able to see color changes on your rectangle.
%width=600 alt='Simple Serial Example' align=top valign=center%[[Attach:rect_bt.jpg|Attach:rect_bt.jpg]]

Added lines 91-93:
%width=600 alt='Serial Ports List' align=top valign=center%[[Attach:serials.jpg|Attach:serials.jpg]]

serials.jpg
Deleted lines 81-82:
Serial myPort;  %color=#7e7e7e%// Create object from Serial class
Changed lines 83-84 from:
%color=#cc6600%int%% val;    %color=#7e7e7e% // Data received from the serial port
to:
Added lines 71-72:
Test this code with FTDI board on, and try to see if you are receiving any values on your serial monitor.
Added line 74:
Added lines 77-93:
Start your Processing sketch and type in following code:

(:div class=code :)
%color=#cc6600%import%% processing.serial.*;

Serial myPort;  %color=#7e7e7e%// Create object from Serial class
%color=#cc6600%int%% val;    %color=#7e7e7e% // Data received from the serial port

void setup()
{

 %color=#cc6600%void%% %color=#cc6600%'''setup'''%%() {
  %color=#cc6600%size%%(200, 200);
  %color=#cc6600%println%%(Serial.%color=#cc6600%list%%());
}

(:divend:)
Added lines 70-73:

Now you can switch to your bluetooth device and battery.
'''Attention:''' If you are not using call and response method, you should put a delay at the end of your code. Otherwise bluetooth locks itself. Unlocking is possible, however we don't want that for now.

Changed lines 54-56 from:
 %color=#cc6600%int%% potPin = 0;    %color=#7e7e7e%// Analog input pin that the potentiometer is attached to
 %color=#cc6600%int%% sensorValue = 0;  %color=#7e7e7e%// value read from the analog sensor
 %color=#cc6600%int%% led = 9;    %color=#7e7e7e%// PWM pin that the LED is on.  n.b. PWM 0 is on digital pin 9
to:
 %color=#cc6600%int%% photocellPin = 0;    %color=#7e7e7e%// Analog input pin that the photocell is attached to
 %color=#cc6600%int%% val = 0;  %color=#7e7e7e%// value read from the analog sensor
Changed lines 54-56 from:
%color=#cc6600% int%%  photocellPin= A0; %color=#7e7e7e%//pin number for photocell
%color=#cc6600% int%% val = 0;
%color=#7e7e7e%//photocell input value
to:
 %color=#cc6600%int%% potPin = 0;    %color=#7e7e7e%// Analog input pin that the potentiometer is attached to
 
%color=#cc6600%int%% sensorValue = 0;  %color=#7e7e7e%// value read from the analog sensor
 %color=#cc6600%int%% led = 9;    %color=#7e7e7e%// PWM pin that the LED is on.  n.b. PWM 0 is on digital pin 9
 

Changed lines 54-56 from:
%color=#cc6600% int photocellPin%% = A0;

%color=#cc6600% int%% val = 0;
to:
%color=#cc6600% int%%  photocellPin= A0; %color=#7e7e7e%//pin number for photocell
%color
=#cc6600% int%% val = 0; %color=#7e7e7e%//photocell input value
Added line 55:
Changed lines 52-67 from:
to:
Now, plug in your FTDI board again, and program your Lily Pad, with following code:
(:div class=code :)
%color=#cc6600% int photocellPin%% = A0;
%color=#cc6600% int%% val = 0;
 %color=#cc6600%void%% %color=#cc6600%'''setup'''%%() {
%color=#cc6600% Serial.begin%%(115200);

}

 %color=#cc6600%void%% %color=#cc6600%'''loop'''%%() {
  val = analogRead(photocellPin);
 %color=#cc6600%  Serial.println%%(val);
 %color=#cc6600%  Serial.flush%%();
 %color=#cc6600%  delay%%(200);
}
(:divend:)
Changed lines 49-51 from:


to:
%width=600 alt='Bluetooth Paired with Your Device' align=top valign=center%[[Attach:paired.jpg|Attach:paired.jpg]]


Changed lines 48-51 from:
%width=600 alt='BDo not use passcode with this device' align=top valign=center%[[Attach:no_pass.jpg|Attach:no_pass.jpg]]


to:
%width=600 alt='Do not use passcode with this device' align=top valign=center%[[Attach:no_pass.jpg|Attach:no_pass.jpg]]


Changed line 46 from:
Afther double clicking your device, laptop will try to pair with bluetooth. It is going to ask you to enter "0000". However, since we are not using a keyboard device, we need to go to "Passcode Options" and click "Do not use passcode with this device"
to:
Afther double clicking your device, laptop will try to pair with bluetooth. It is going to ask you to enter "0000". However, since we are not using a keyboard device, we need to go to "Passcode Options" and click "Do not use passcode with this device".
Changed lines 48-50 from:


to:
%width=600 alt='BDo not use passcode with this device' align=top valign=center%[[Attach:no_pass.jpg|Attach:no_pass.jpg]]


Changed lines 47-50 from:
%width=600 alt='Bluetooth Passcode Screen' align=top valign=center%[[Attach:bt_fail.jpg.jpg|Attach:bt_fail.jpg.jpg]]


to:
%width=600 alt='Bluetooth Passcode Screen' align=top valign=center%[[Attach:bt_fail.jpg|Attach:bt_fail.jpg]]


Changed lines 46-50 from:
to:
Afther double clicking your device, laptop will try to pair with bluetooth. It is going to ask you to enter "0000". However, since we are not using a keyboard device, we need to go to "Passcode Options" and click "Do not use passcode with this device"
%width=600 alt='Bluetooth Passcode Screen' align=top valign=center%[[Attach:bt_fail.jpg.jpg|Attach:bt_fail.jpg.jpg]]


Changed lines 38-41 from:
After uploading your sketch, you can unplug FTDI board and plug in bluetooth mate, and lithium battery. Start LED on bluetooth mate should start blinking. 
%width=600 alt='Lily Pad with bluetooth & battery' align=top valign=center%[[Attach:lily_bt.jpg|Attach:lily_bt.jpg]]
[[Bluetooth mate]]
's pins are matching with Lily Pad's, so don't worry about the connection.
to:
After uploading your sketch, you can unplug FTDI board and plug in bluetooth mate, and lithium battery. Start LED on bluetooth mate should start blinking.  Bluetooth mate's pins are matching with Lily Pad's, so don't worry about the connection.
Changed lines 2-3 from:
In this lab, you'll learn how to how to use bluemate, bluetooth module with Arduino Lily Pad. You will be able to receive serial values through bluetooth to  processing, wirelessly.
to:
In this lab, you'll learn how to how to use bluetooth mate, bluetooth module with Arduino Lily Pad. You will be able to receive serial values through bluetooth to  processing, wirelessly.
Changed lines 12-13 from:
%lframe width=100px valign=center%[[Attach:bluemate.jpg|Attach:bluemate.jpg"Bluemate"]] | [-Bluemate-]
%lframe width=100px valign=center%[[Attach:lithyum_battery.jpg|Attach:lithyum_battery.jpg"LithyumBattery"]] | [-Lithyum Battery-]
to:
%lframe width=100px valign=center%[[Attach:bluemate.jpg|Attach:bluemate.jpg"Bluetooth mate"]] | [-Bluetooth mate-]
%lframe width=100px valign=center%[[Attach:lithyum_battery.jpg|Attach:lithyum_battery.jpg"LithiumBattery"]] | [-Lithium Battery-]
Changed lines 21-22 from:
First time we use the bluemate with our laptop, we need to introduce them to each other by using pairing.
to:
First time we use the bluetooth mate with our laptop, we need to introduce them to each other by using pairing.
Changed lines 36-37 from:
Bluemate are coming as their boud rate pre programmed, which is "115200". After choosing your board and serial port, upload your code to your Lily Pad.
to:
Bluetooth mate are coming as their boud rate pre programmed, which is "115200". After choosing your board and serial port, upload your code to your Lily Pad.

After uploading your sketch, you can unplug FTDI board and plug in bluetooth mate, and lithium battery. Start LED on bluetooth mate should start blinking. 
%width=600 alt='Lily Pad with bluetooth & battery' align=top valign=center%[[Attach:lily_bt.jpg|Attach:lily_bt.jpg]]
[[Bluetooth mate]]'s pins are matching with Lily Pad's, so don't worry about the connection
.
Changed lines 41-42 from:
Then, your machine will start searching for bluetooth devices around you. Your bluetooth device will be "FireFly-xxxx";
to:
Then, your machine will start searching for bluetooth devices around you. Your bluetooth device will be "FireFly-xxxx".
Changed lines 41-42 from:
Then, your machine will start searching for bluetooth devices around you. Your bluetooth device will be "FireFly-xxx";
to:
Then, your machine will start searching for bluetooth devices around you. Your bluetooth device will be "FireFly-xxxx";
Added lines 41-44:
Then, your machine will start searching for bluetooth devices around you. Your bluetooth device will be "FireFly-xxx";

%width=600 alt='Search Bluetooth' align=top valign=center%[[Attach:search_bt.jpg|Attach:search_bt.jpg]]

Changed lines 38-40 from:
Now Turn on your bluetooth settings and choose "Setup Bluetooth Device" option.
%width=600 alt='Setup Bluetooth Device' align=top valign=center%[[Attach:setup_bluetooth.jpg|Attach:setup_bluetooth.jpg]]
to:
Now Turn on your bluetooth settings and choose "Set Up Bluetooth Device" option.
%width=600 alt='Set Up Bluetooth Device' align=top valign=center%[[Attach:setup_bluetooth.jpg|Attach:setup_bluetooth.jpg]]
Changed lines 39-40 from:
%width=600 alt='Setup Bluetooth Device' align=top valign=center%[[Attach:setup_bluetooth.jpg|setup_bluetooth.jpg]]
to:
%width=600 alt='Setup Bluetooth Device' align=top valign=center%[[Attach:setup_bluetooth.jpg|Attach:setup_bluetooth.jpg]]
Changed line 20 from:
!!!Pair Bluetooth and Your Laptop
to:
!!!Pair Bluetooth and Laptop
Changed lines 38-40 from:
to:
Now Turn on your bluetooth settings and choose "Setup Bluetooth Device" option.
%width=600 alt='Setup Bluetooth Device' align=top valign=center%[[Attach:setup_bluetooth.jpg|setup_bluetooth.jpg]]

Changed line 18 from:
to:
[[<<]]
Changed line 19 from:
to:
(:table:)
Added lines 18-19:

Added line 28:
Changed line 27 from:
color=#cc6600% Serial.begin%%(115200);
to:
%color=#cc6600% Serial.begin%%(115200);
Changed lines 26-27 from:
void setup(){
 Serial.begin
(115200);
to:
 %color=#cc6600%void%% %color=#cc6600%'''setup'''%%() {
color=#cc6600% Serial.begin%%
(115200);
Changed lines 29-30 from:
void loop(){
to:

 %color=#cc6600%void%% %color=#cc6600%'''
loop'''%%() {
Added lines 24-34:
Then start programing your Lily Pad with the following code:
(:div class=code :)
void setup(){
 Serial.begin(115200);
}
void loop(){
}
(:divend:)
Bluemate are coming as their boud rate pre programmed, which is "115200". After choosing your board and serial port, upload your code to your Lily Pad.

Changed lines 16-17 from:
%lframe width=100px valign=center%[[Attach:photocell.jpg|Attach:photocell.jpg.jpg"2Photocell"]] | [-Photocell-]
to:
%lframe width=100px valign=center%[[Attach:photocell.jpg|Attach:photocell.jpg"2Photocell"]] | [-Photocell-]

!!!Pair Bluetooth and Your Laptop
First time we use the bluemate with our laptop, we need to introduce them to each other by using pairing.

Plug your FTDI chip to your LilyPad, first. 
%width=600 alt='Lily Pad connected to FTDI' align=top valign=center%[[Attach:lily_ftdi.jpg|Attach:lily_ftdi.jpg]
]
Changed lines 2-8 from:
to:
In this lab, you'll learn how to how to use bluemate, bluetooth module with Arduino Lily Pad. You will be able to receive serial values through bluetooth to  processing, wirelessly.

(:toc Table of Contents:)

!!! Parts

For this lab you will need to have the following parts:
Changed lines 15-17 from:
to:
%lframe width=100px valign=center%[[Attach:hookup_wire.jpg|Attach:hookup_wire.jpg"22-AWG Hookup Wire"]] | [-12-AWG Hookup Wire-]
%lframe width=100px valign=center%[[Attach:photocell.jpg|Attach:photocell.jpg.jpg"2Photocell"]] | [-Photocell-]

Changed lines 8-9 from:
to:
%lframe width=100px valign=center%[[Attach:resistors_220.jpg|Attach:resistors_220.jpg"10K Resistor"]] | [-10K Resistor-]
Changed lines 5-6 from:
%lframe width=100px valign=center%[[Attach:lillypad_li.jpg|Attach:lillypad_li.jpg"Lily Pad LiPower"]] | [-+Lily Pad LiPower-]
to:
%lframe width=100px valign=center%[[Attach:lillypad_li.jpg|Attach:lillypad_li.jpg"Lily Pad LiPower"]] | [-Lily Pad LiPower-]
%lframe width=100px valign=center%[[Attach:bluemate.jpg|Attach:bluemate.jpg"Bluemate"]] | [-Bluemate-]
%lframe width=100px valign=center%[[Attach:lithyum_battery.jpg|Attach:lithyum_battery.jpg"LithyumBattery"]] | [-Lithyum Battery
-]
Changed lines 5-6 from:
%lframe width=100px valign=center%[[Attach:llillypad_li.jpg|Attach:llillypad_li.jpg"Lily Pad LiPower"]] | [-+Lily Pad LiPower-]
to:
%lframe width=100px valign=center%[[Attach:lillypad_li.jpg|Attach:lillypad_li.jpg"Lily Pad LiPower"]] | [-+Lily Pad LiPower-]
Changed lines 5-6 from:
%lframe width=100px valign=center%[[Attach:lilypad_li.jpg|Attach:lilypad_li.jpg"Lily Pad LiPower"]] | [-+Lily Pad LiPower-]
to:
%lframe width=100px valign=center%[[Attach:llillypad_li.jpg|Attach:llillypad_li.jpg"Lily Pad LiPower"]] | [-+Lily Pad LiPower-]
Changed lines 2-3 from:
<<<<<<<
to:
Changed lines 5-8 from:

=======

>>>>>>>
to:
%lframe width=100px valign=center%[[Attach:lilypad_li.jpg|Attach:lilypad_li.jpg"Lily Pad LiPower"]] | [-+Lily Pad LiPower-]
Changed lines 5-6 from:
%lframe width=100px valign=center%[[Attach:FTDI|Attach:FTDI"+3.3V FTDI"]] | [-+3.3V FTDI Board-]
to:
%lframe width=100px valign=center%[[Attach:FTDI.jpg|Attach:FTDI.jpg"+3.3V FTDI"]] | [-+3.3V FTDI Board-]
Deleted lines 8-10:
%lframe width=100px valign=center%[[Attach:breadboard.jpg|Attach:breadboard.jpg"solderless breadboard"]] | [-Solderless breadboard-]
%lframe width=100px valign=center%[[Attach:FTDI.jpg|Attach:FTDI.jpg"+3.3V FTDI"]] | [-+3.3V FTDI Board-]

Changed lines 2-3 from:
to:
<<<<<<<
Added lines 5-9:
%lframe width=100px valign=center%[[Attach:FTDI|Attach:FTDI"+3.3V FTDI"]] | [-+3.3V FTDI Board-]

=======

%lframe width=100px valign=center%[[Attach:breadboard.jpg|Attach:breadboard.jpg"solderless breadboard"]] | [-Solderless breadboard-]
Added line 12:
>>>>>>>
Added lines 2-5:

%lframe width=100px valign=center%[[Attach:breadboard.jpg|Attach:breadboard.jpg"solderless breadboard"]] | [-Solderless breadboard-]
%lframe width=100px valign=center%[[Attach:FTDI.jpg|Attach:FTDI.jpg"+3.3V FTDI"]] | [-+3.3V FTDI Board-]

Added line 1:
'''Bluetooth Lab'''
  Edit | View | History | Print | Recent Changes | Search Page last modified on November 22, 2010, at 07:42 PM