Monday, October 29, 2012

Wednesday, October 24, 2012

BUY COMPONENT FOR ARDUINO PCB


  1. 6x12mx3m PCB stand
  2.  3x12m PCB stand
  3. 9V battery holder
  4. 1x40 female holder
  5. 1x40 pin header
  6. 5k ACP preset
  7. 10k ACP preset
  8. Wire set
  9. 28 pin IC socket
  10. Acid
  11. Mini slide switch


Friday, October 5, 2012

TO MAKE THE PROGRM


int redPin = 9;            // connect red LED to pin 9 arduino
int greenPin = 10;     // connect green LED to pin 10 arduino
int bluePin = 11;       // connect blue LED to pin 11 arduino
int buzzerPin = 7;     // connect buzzer to pin 7 arduino
int potPin = 1;
int sensorPin = 0;
long red = 0xFF0000;
long green = 0x00FF00;
long blue = 0x000080;
int band = 10;
// adjust for sensitivity
void setup()
{
pinMode(potPin, INPUT);
pinMode(sensorPin, INPUT);
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);
pinMode(buzzerPin, OUTPUT);
}

void loop()
{

int gsr = analogRead(sensorPin);
int pot = analogRead(potPin);
if (gsr > pot + band)
{
setColor(red);
beep();
}
else if (gsr < pot - band)
{
setColor(blue);
}
else
{
setColor(green);
}
}
void setColor(long rgb)
{
int red = rgb >> 16;
int green = (rgb >> 8) & 0xFF;
int blue = rgb & 0xFF;
analogWrite(redPin, 255 - red);
analogWrite(greenPin, 255 - green);
analogWrite(bluePin, 255 - blue);
}
void beep()
{
// 5 Khz for 1/5th second
for (int i = 0; i < 1000; i++)
{
digitalWrite(buzzerPin, HIGH);
delayMicroseconds(100);
digitalWrite(buzzerPin, LOW);
delayMicroseconds(100);
}
}

Tuesday, October 2, 2012

Related Posts Plugin for WordPress, Blogger...