I am not looking to learn how to program at this time, i am not looking for guidance on how to program. I am looking to pay someone $50. to basically add a millis command (I think) to a program for me. This is what I have so far
// These constants won't change:
const int analogPin = A0; // pin that the camera PWR sensor is attached to
const int ledPin = 12; // pin that the camera PWR button is attached to
const int threshold = 475; // an arbitrary threshold level that's in the range of the analog input
void setup() {
// initialize the Camera PWR button as an output:
pinMode(ledPin, OUTPUT);
// initialize serial communications:
Serial.begin(9600);
}
void loop() {
// read the value of the camera PWR:
int analogValue = analogRead(analogPin);
// if the analog value is too low, "Press" the PWR button:
if (analogValue < threshold) {
Serial.println("Pressing PWR in 2 seconds; then delay for 5 seconds");
delay(2000);
digitalWrite(ledPin, HIGH);
delay(500);
digitalWrite(ledPin, LOW);
delay(5000);
}
else {
digitalWrite(ledPin,LOW);
}
// print the analog value:
Serial.println(analogValue, DEC);
}
This seems to work so far. It monitors a camera and it turns the camera on if it shuts off. I would like to make it press a REC button after it sees that the camera is on. I have a photoresistor connected to a blinking LED on the front of the camera so it knows if the camera is recording or not. I have the photoresistor connected to a 10k resistor and I can monitor the blinking LED light using this code
int lightPin = A1; //define a pin for Photo resistor
int ledPin=11; //define a pin for LED
void setup()
{
Serial.begin(9600); //Begin serial communcation
pinMode( ledPin, OUTPUT );
}
void loop()
{
Serial.println(analogRead(lightPin)); //Write the value of the photoresistor to the serial monitor.
analogWrite(ledPin, analogRead(lightPin)/4); //send the value to the ledPin. Depending on value of resistor
//you have to divide the value. for example,
//with a 10k resistor divide the value by 2, for 100k resistor divide by 4.
delay(10); //short delay for faster response to light.
}
I would like to combine these 2 codes and when it needs to rec have it send a signal for a few milliseconds on a desired output (I have a 5 volt relay to do the mechanical part) I believe this would only take someone who knows what they are doing about 20 minutes. I would like to skype with someone just to show them exactly what needs to be done and then i believe it to be relatively simple. I'm sure i have left a lot out but I will answer any questions you may have on skype. This is just to initially give a brief description of what I am asking. Please msg me if you are interested.