thanks,
do you know where i could find the code to run it after i build the op amp?
or how to change the curent code i'm the led on?
int led = 13;
int potvalue = 0;
int trigger = 2; // pin for the LED
int dataIn = 3;
int x;
unsigned long TimPulse;
long timeOut = 1000000;
void setup() {
pinMode(trigger, OUTPUT); // declare the ledPin as an output
pinMode(dataIn, INPUT); // declare the ledPin as an output
Serial.begin(9600); // initialize the serial port
}
void loop() {
digitalWrite(trigger, HIGH);
delayMicroseconds(50);
digitalWrite(trigger, LOW);
TimPulse = pulseIn(dataIn, HIGH);
// scale down pulse val to 0-255
TimPulse = TimPulse / 125;
// reverse that
TimPulse = 255 - TimPulse;
Serial.println(TimPulse, DEC);
analogWrite(led, TimPulse);
// wait a bit
delay(100);
}
cheers,
casey