In the monski pong project in chapter 2, there is an error in checking the ball position relative to the paddle. The collision detection routine in animateBall() (p.66 first edition) assumes the ball’s position is being checked from the center of the paddle. In order to make this possible, you need to set the rectMode to CENTER.  In the setup(), add

rectMode(CENTER);

and all will be well.  The code example has been updated to reflect this.

Negotiating in Bluetooth

 Chapter 2, Errata  Comments Off on Negotiating in Bluetooth
Jan 072008
 

In the first edition of the book, there is no code for Project 3, Negotiating in Bluetooth. The project just describes how to use the blueSMiRF radio. With the BlueSMiRF v.2 radios from Spark Fun, the principles are the same, but the commands are different, because the BlueSMiRF v.2 is based on a different Bluetooth Radio (see this post for more). The full list of AT commands for this radio is online here. What follows is an update to Project 3, Negotiating in Bluetooth”

Continue reading »

Wireless Monski Pong

 Chapter 2, Errata  Comments Off on Wireless Monski Pong
Jan 072008
 

In the first edition of the book, there is no additional code for Wireless Monski Pong. The project just describes how to set up the project using the blueSMiRF radio. With the BlueSMiRF v.2 radios from Spark Fun, the wiring is the same as it was with the original blueSMiRF. Configuration is virtually the same as well. The only changes are as follows:

The device name for the BlueSMiRF v.2 radio is SparkFun-BT.

These radios don’t use a passcode, so when you search for the device, you want to choose not to use a passkey. For OSX users, this means that after you’ve selected the device type as “Any Device”, you’ll get the device discovery screen. Click the Passkey Options… button and select “Do not use a passkey with this device”. Then select the SparkFun-BT device.

For Windows users, the process should be the same. Unfortunately I don’t have a Windows machine to test with at the moment, I’ll update this post when I have one.

Once you’ve paired with the BlueSMiRF v.2, the instructions in the book will work just as they did with the original BlueSMiRF. The BlueSMiRF v.2 will not send out a CONNECT message when your computer connects to it, however.

Sparkfun BlueSMiRF v.2

 Chapter 2, Chapter 6, Chapter 8, Errata  Comments Off on Sparkfun BlueSMiRF v.2
Jan 072008
 

The bad news: Spark Fun changed the radio on the BlueSMiRF radios. The SMiRFs I used in the first edition of the book used the BlueRadios radios. The new SMiRFs use the Roving Networks radios.

The good news: Spark Fun also released the BlueSMiRF v.2, which is slightly cheaper, and uses the Philips BGB203 radio. The command set for the BGB203 is nice, and can do many things the BlueRadios devices could do, and more. I’ll be updating the code examples here on this site, so you know how to use the new radios.

Diagram error

 Chapter 2, Errata  Comments Off on Diagram error
Oct 092007
 

On page 51, in the Synchronous Serial Communication diagram, the third pin on the master chip is labeled “Master Out Slave Out”. It should be labeled “Master Out Slave In.”

Thanks to Michael Schneider for catching this.

Sensor reader

 Arduino/Wiring, Chapter 2  Comments Off on Sensor reader
Oct 072007
 
/*
  Sensor Reader
  Language: Wiring/Arduino

  Reads two analog inputs and two digital inputs 
  and outputs their values.
  Connections:  
    analog sensors on analog input pins 0 and 1
    switches on digital I/O pins 2 and 3
*/

Continue reading »

Serial String Reader

 Chapter 2, Processing  Comments Off on Serial String Reader
Oct 072007
 
/*  
  Serial String Reader
  Language: Processing
 
  Reads in a string of characters from a serial port until 
  it gets a linefeed (ASCII 10).  Then splits the string into 
  sections separated by commas. Then converts the sections to ints, 
  and prints them out.
*/

Continue reading »

Monski Pong

 Chapter 2, Processing  Comments Off on Monski Pong
Oct 072007
 
/*
  Monski Pong
  Language: Processing

  Uses the values from four sensors to animate a game of pong.
  Expects a serial string from the serial port in the following format:
    leftPaddle,rightPaddle,resetButton,serveButton,linefeed
    leftPaddle: ASCII numeric string from 0 - 1023
    rightPaddle: ASCII numeric string from 0 - 1023
    resetButton: ASCII numeric string from 0 - 1
    serveButton: ASCII numeric string from 0 - 1

    modified 28 Jan 2009
    Thanks to anonymous reader for the correction

*/

Continue reading »

Monski pong with handshake

 Chapter 2, Processing  Comments Off on Monski pong with handshake
Oct 072007
 
/*
  Monski Pong with Handshake
  Language: Processing

  Uses the values from four sensors to animate a game of pong. 
  Expects a serial string from the serial port in the following format: 
    leftPaddle,rightPaddle,resetButton,serveButton,linefeed
    leftPaddle: ASCII numeric string from 0 - 1023
    rightPaddle: ASCII numeric string from 0 - 1023
    resetButton: ASCII numeric string from 0 - 1
    serveButton: ASCII numeric string from 0 - 1
 
   Uses software handshaking by sending a carriage return 
   for the microcontroller to respond to.
 */

Continue reading »

© 2012 Making Things Talk Suffusion theme by Sayontan Sinha