User:Ben ot/ENES-100/project 1 - BioFeedBack/CDIO

=Project 1= =Conceive=

Problem Statement
Understanding the arduino board, and making it blink, fade, flash etc. Eventually hack the EEG toy and hook it up to the pulse sensor.

Conception
Make the fan go on to move the ball or change the color of the LED based on pulse/moode change.

Design
In order to get the RGB LED to light up through the arduino, plug the black wire into ground and the red, white and green wires to correspond with the code. This will make the LED light up. To make it blink or flash, just run the program. You may have to tweak the code. To get the arduino to flash different colors use this Link. Edit the code to change the colors speed etc.

Utilization of Knowledge
Change codes to make it flash specific colors or change intensity.

Next Steps
The next steps for this project is to hook it up to the pulse sensor and get it to change different colors based on pulse. Eventually We want to hook up the EEG toy with it. Next the pulse sensor code needs to be combined with the something that will make the LED change color.

COMBINING CODE
In order to combine blink and fade the first steps are to copy and paste the two examples in the same sketch, then rename any functions that have the same name. THIS WILL NOT WORK YET, but this is about halfway done. "

/* Blink Turns on an LED on for one second, then off for one second, repeatedly. This example code is in the public domain. */ // Pin 13 has an LED connected on most Arduino boards. // give it a name: int led = 10; // the setup routine runs once when you press reset: void setup { // initialize the digital pin as an output. pinMode(led, OUTPUT); }

// the loop routine runs over and over again forever: void loop { digitalWrite(led, HIGH);  // turn the LED on (HIGH is the voltage level) delay(1000);              // wait for a second digitalWrite(led, LOW);   // turn the LED off by making the voltage LOW delay(1000);              // wait for a second }/* Fade This example shows how to fade an LED on pin 9 using the analogWrite function. This example code is in the public domain. */

int led2 = 9;          // the pin that the LED is attached to int brightness = 0;    // how bright the LED is int fadeAmount = 5;    // how many points to fade the LED by

// the setup routine runs once when you press reset: void setup { // declare pin 9 to be an output: pinMode(led, OUTPUT); }

// the loop routine runs over and over again forever: void loop { // set the brightness of pin 9: analogWrite(led, brightness);

// change the brightness for next time through the loop: brightness = brightness + fadeAmount;

// reverse the direction of the fading at the ends of the fade: if (brightness == 0 || brightness == 255) { fadeAmount = -fadeAmount ; }      // wait for 30 milliseconds to see the dimming effect delay(30); "