Human-Computer Interface Technology 2

  
Inside:
Repository
Prototype 2 uses the same base to control different elements. This time we have added a button to make the tone play only when it is pressed, as well as a rotary potentiometer for volume control. /* ADXL3xx Reads an Analog Devices ADXL3xx accelerometer and communicates the acceleration to the computer. For AdaFruit ADXL335 breakout board. Modified
Human-Computer Interface Technology 2 - schematic

from code at The circuit: analog 0: Vin analog 1: 3vo analog 2: ground analog 3: z-axis analog 4: y-axis analog 5: x-axis test pin is hanging off the edge :) created 2 Jul 2008 by David A. Mellis by Tom Igoe modified 19 Feb 2013 by Rebecca Fiebrink This example code is in the public domain. */ // these constants describe the pins. They won`t change: const int groundpin = A2; // analog input pin 2 const int powerpin = A0; // analog input pin 0 const int xpin = A5; // x-axis of the accelerometer const int ypin = A4; // y-axis const int zpin = A3; // z-axis void setup() { // initialize the serial communications: Serial. begin(9600); // Provide ground and power by using the analog inputs as normal // digital pins. This makes it possible to directly connect the // breakout board to the Arduino. If you use the normal 5V and // GND pins on the Arduino, you can remove these lines. pinMode(groundpin, OUTPUT); pinMode(powerpin, OUTPUT); digitalWrite(groundpin, LOW); digitalWrite(powerpin, HIGH); } void loop() { // print the sensor values: Serial. print(analogRead(xpin); // print a tab between values: Serial. print(" "); Serial. print(analogRead(ypin); // print a tab between values: Serial. print(" "); Serial. print(analogRead(zpin); Serial. println(); int xfreq = analogRead(xpin); int yfreq = analogRead(ypin); int zfreq = analogRead(zpin); tone(8, xfreq+yfreq+zfreq); // delay before next reading: delay(100); } Our group built a an...



Leave Comment

characters left:

New Circuits

.