Skip to content

Commit

Permalink
updated readmes
Browse files Browse the repository at this point in the history
  • Loading branch information
byronxu99 committed Jun 25, 2018
1 parent efcfb7d commit c297962
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examples/AccelerometerGyroscope/README.md
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.

8 changes: 8 additions & 0 deletions examples/LightSensor/README.md
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.

6 changes: 6 additions & 0 deletions examples/TouchSensor/README.md
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.

0 comments on commit c297962

Please sign in to comment.