-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
15 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
## I2C Accelerometer and Gyroscope | ||
**Boards:** Master, valve board, and Grove extension board</br> | ||
**Tube connections:** Same as previous example | ||
**Tube connections:** Same as the [Gesture Sensor](../GestureSensor) example | ||
|
||
The Grove 6-axis Accelerometer and Gyroscope is another sensor that can be used to allow physical input to control inflatables. This example shows how to use the sensor and its corresponding library to respond to motion. In this example, the gyroscope readings are used to detect shaking. When a strong motion is detected, the valve is turned on for a moment. Gently tapping the sensor will send a brief pulse of air to the inflatable, and vigorously shaking the sensor will hold the valve open. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
## Light Sensor | ||
**Boards:** Master, valve board, and Grove extension board</br> | ||
**Tube connections:** Same as the [Pressure Regulation](../PressureRegulator) example | ||
|
||
Pneuduino's Grove extension board allows for Grove I2C sensors to be plugged in, but analog sensors can also be used via the [Grove I2C ADC](http://wiki.seeedstudio.com/Grove-I2C_ADC/). In this example, we read analog values from the Light Sensor and use them to control the pressure of an inflatable. | ||
|
||
The code to read the ADC can be found on the device's wiki page, linked above. In `loop()`, the reading (ranging from roughly zero to 2400) is mapped to a range of common pressures for inflatables. As this example sets pressure using the library's automatic pressure regulation functionality, connect tubing in the same manner as in the Pressure Regulation example. Expose the sensor to bright light, and the inflatable will be inflated firmly. Dim the light, and the inflatable will become softer. Cover up the sensor, and pressure will be released. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
## I2C Touch Sensor | ||
**Boards:** Master, valve board, and Grove extension board</br> | ||
**Tube connections:** Same as the [Gesture Sensor](../GestureSensor) example | ||
|
||
The Grove I2C Touch Sensor is a multi-channel capacitive touch sensor that allows for easy tactile input and feedback. It is able to detect touch through thin surfaces, meaning that it can be placed inside an inflatable. In this example, we demonstrate how to use the touch sensor's library. After initializing in `setup()`, we update the sensor's state with a call to `getTouchState()`. The new data is written to the `touched` variable. When a touch on any channel is observed, `touched` will be non-zero. (To see the specific channel(s), the *n*-th bit will be set to `1` if the *n*-th channel is touched.) We open the valve for a brief amount of time whenever a touch is observed. | ||
|