Skip to content

Commit

Permalink
Orgqanized light sensors together
Browse files Browse the repository at this point in the history
  • Loading branch information
tigoe committed Jan 18, 2019
1 parent 7f321a3 commit 50cc0cf
Show file tree
Hide file tree
Showing 17 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void setup(void) {
Serial.begin(9600);
// initialize communications with the accelerometer:
if (! mma.begin()) {
Serial.println("Couldnt start. Check wiring the to the sensor.");
Serial.println("Couldn't start. Check wiring the to the sensor.");
while (true); // stop here and do nothing else
}
// set accelerometer range to 2G max:
Expand All @@ -39,5 +39,4 @@ void loop() {
Serial.print(mma.y);
Serial.print("\tZ: ");
Serial.println(mma.z);

}
6 changes: 5 additions & 1 deletion Accelerometers/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ Analog Devices makes a family of accelerometers, the [ADXL3xx accelerometers](ht

## STMicroelectronics LIS3DH

STMicroelectronics' [LIS3DH accelerometer](https://www.st.com/en/mems-and-sensors/lis3dh.html) is an inexpensive accelerometer with a variable range of sensitivity. It connects to a microcontroller using I2C. It's a great one to use when budget is a consideration. It also has some nice features like tap detection on all three axes.
STMicroelectronics' [LIS3DH accelerometer](https://www.st.com/en/mems-and-sensors/lis3dh.html) is an inexpensive accelerometer with a variable range of sensitivity. It connects to a microcontroller using I2C. It's a great one to use when budget is a consideration. It also has some nice features like tap detection on all three axes.

## Freescale MMA8451

Freescale's MMA8451 is an inexpensive accelerometer that communicates over I2C. Adafruit has an [MMA8451 breakout board](https://www.adafruit.com/product/2019)
13 changes: 7 additions & 6 deletions AdafruitJoystick/AdafruitJoystick.ino → Joystick/Joystick.ino
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
/*
Adafruit joystick example
Joystick example
Reads an Adafruit joystick and maps the X and Y outputs to a range from
-1 to 1. Also inverts the button reading so that pressed = 1 and unpressed = 0
Reads an Adafruit or Sparkfun joystick and maps the X and Y outputs to a range
from -1 to 1. Also inverts the button reading so that pressed = 1 and unpressed = 0
circuit: Adafruit joystick attached to A0 through A4, with Vcc on A0
(https://www.adafruit.com/products/512)
circuit: joystick attached to A0 through A4, with sensor pins on A1, A2, and A3
created 10 Sept 2012
modified 18 Jan 2019
by Tom Igoe
*/
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
// configure analog pins for Adafruit joystick:
// configure analog pins for joystick
// Check your joystick breakout board for correct pins:
pinMode(A0, OUTPUT);
pinMode(A4, OUTPUT);
pinMode(A3, INPUT_PULLUP); // joystick pushbutton
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 50cc0cf

Please sign in to comment.