Interactive Project Documentation

air guitar simulate glove

peter liang ban li

summary : this is a air guitar simulate glove. It will sense your glove location to produce sound.with different location of the glove the CPX (circuits playground express) will produce different sound.

material: glove , tape or hair band, battery supply.

1. this project is planed to produce electronic sound with you hand gesture.

2. make sure you create the code that can transfer the accelerometer data to sound produce data.

#include <Adafruit_CircuitPlayground.h>

float X, Y, Z;

void setup() {

  Serial.begin(9600);

  CircuitPlayground.begin();

}

void loop() {

  X = CircuitPlayground.motionX();

  Y = CircuitPlayground.motionY();

  Z = CircuitPlayground.motionZ();

  Serial.print(“X: “);

  Serial.print(X);

  Serial.print(“  Y: “);

  Serial.print(Y);

  Serial.print(“  Z: “);

  Serial.print(Z);

  Serial.print(“X+Y+Z: “);

  Serial.println(X+Y+Z);

  if (CircuitPlayground.slideSwitch()){

float frequency = map(X+Y+Z, 3,23,100,500);

  CircuitPlayground.playTone(frequency, 130);

  Serial.print (“frequency “);

  Serial.print (frequency);

  }

  

  float frequency = map(X+Y+Z, 3,23,3000,4000);

  CircuitPlayground.playTone(frequency, 60);

  Serial.print (“frequency “);

  Serial.print (frequency);

  }

Improvement: the sound function of the CPX is limited, the hand location detective can be improve to hand movement. detective.