Correction to Cat Project parts list

The Materials section on page 94 calls for between 2 and 4 10-kilohm resistors. In fact, you only need one resistor. On page 100, the schematic calls for a 1K resistor. You may need a higher value depending on the resistance range of your force sensing resistors and the weight of your cat. IF a 1K resistor doesn’t give you good values, try a 4.7K or a 10K resistor.

Chapter 3
Errata

Comments Off

Permalink

Error in the Cat Graphing example

In the cat graphing example in chapter 3 as published in the book, the comments say:

// if the sensor value is less than the threshold,
// and the previous value was greater, then the cat
// just left the mat
if (prevSensorValue >= threshold) {
   catOnMat = false;
}

According to the second comment, the condition should be “greater,” but actual code is “greater or equal.”

The comment is right and the code should be as follows:

// if the sensor value is less than the threshold,
// and the previous value was greater, then the cat
// just left the mat
if (prevSensorValue > threshold) {
   catOnMat = false;
}

Thanks to Shigeru Kobayashi for catching this.

Chapter 3
Errata

Comments (0)

Permalink

Comment error in simple serial code

In the Chapter 1 Simple Serial code as published in the book says:

// after a quarter of a second, turn the LED on:

It should say

// after a half of a second, turn the LED on:

Thanks to Shigeru Kobayashi for catching it.

Chapter 1
Errata

Comments (0)

Permalink

Xport Pong Emulator

This Processing sketch sends the same bytes as the Xport that’s configured for the networked Pong game in Chapter 5. It’s a handy way to connect a microcontroller to the server when you don’t have an Xport, or aren’t sure your Xport is working.

Continue Reading »

Chapter 5
Processing
Updates
etech2008

Comments Off

Permalink

Analog Output

/*
 Analog output
 Language: Wiring/Arduino

 Reads an analog input and uses its value to dim an LED output
 Connections:
 analog sensor on analog input pins 0
 LED on digital pin 3
 */

Continue Reading »

Arduino/Wiring
etech2008

Comments Off

Permalink

Simple Sensor Reader

This program reads two analog sensors and one digital sensor and prints them out. Use it for testing your sensors.

Continue Reading »

Arduino/Wiring
etech2008

Comments Off

Permalink

Reading a Switch

This program reads a switch (i.e. a digital input) and changes an LED only when the switch changes from off to on. You can modify it to count switch presses as well. There’s a digital input connected to Digital I/O pin 2, and an LED attached to digital I/O pin 3. I refer to this method of detecting when the switch has changed as edge detection on a switch

Continue Reading »

etech2008

Comments Off

Permalink

Monski Pong Server error

There is an error in the Monski Pong code in chapter 5. An update has been posted to the original post. The delayCounter variable should have been a long, not a float, and it should have been initialized in the setup(), not before, so that it gets an initial value that’s very low.

Chapter 5
Errata

Comments Off

Permalink

Negotiating in Bluetooth

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 »

Chapter 2
Errata

Comments Off

Permalink

Wireless Monski Pong

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.

Chapter 2
Errata

Comments Off

Permalink