Commit 8106ced4 authored by Phoenix Perry's avatar Phoenix Perry

adding week 6

parent 079beced
## Week 6
##Week 6 Labs:
**PART ONE:**
In this folder you will find a base circuit for the MPR121 breakout board. To get the library and watch the video on how it works go here: <http://bildr.org/2011/05/mpr121_arduino/>
Working in groups, try out the MPR121 capacitive touch board. Create a circuit digram and video of any creative idea you have that make some output respond to physical touch. People can leverage cooper tape, conductive paint, tinfoil or any other metal surface like a row of stairs with a metal strip on them. Be creative and have fun!
**Part Two**
Scopes and signals
Try to generate a wave form on the scope - play with seeing what data you get out of your sensors
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
//pinMode(0, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
float value(touchRead(A2, A6));
//Serial.print("A6+++++");
Serial.println(value);
float value1(touchRead(A2, A4));
//Serial.print("A4---");
Serial.println(value1);
digitalWrite(0, HIGH);
}
int touchRead(int pin1, int pin2)
{
int sum = 0;
// for(int i = 0; i < 10; i++)
// {
pinMode(pin1, OUTPUT);
digitalWrite(pin1, HIGH);
// delayMicroseconds(10);
int high = analogRead(pin2);
digitalWrite(pin1, LOW);
delayMicroseconds(10);
int low = analogRead(pin2);
pinMode(pin1, INPUT);
// digitalWrite(pin1, LOW);
sum = sum + high-low;
// }
return(int)((float)sum/4.0f);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment