Welcome Anonymous
Fledgling
Fledgling
It is currently Sat Jun 23, 2018 11:11 pm

All times are



Post new topic Reply to topic  [ Array ]  Go to page Previous  1, 2, 3
Author Message
PostPosted: Thu Mar 08, 2018 11:05 am 
Offline
Fledgling
Fledgling

Joined: Tue Jan 02, 2018 3:29 am
Posts: 39
Location: England, UK
Gartooth wrote:
Try this... I think it will work but don't have an unit to test at the moment. Pin 1 is shutter, Pin 3 is meter. Meter fires for 1/2 second upon motion event, then shutter & meter both fire 2 times with 400 ms gap between fires. If you do not want the meter to wake up the flash for 1/2 second, then just delete that line and the delay 500 line that follows. You may need to adjust your remaining delays to be sure the code does not run twice. Depends how long your motion sensor pulse is.

int motion_1 = 2;
int shutter_1 = 1;
int meter_1 = 3;

void setup() {
pinMode (motion_1, INPUT);
pinMode (shutter_1, OUTPUT);
pinMode (meter_1, OUTPUT);
}

void loop () {
digitalWrite (shutter_1, LOW);
digitalWrite (meter_1, LOW);

int sensor_1 = digitalRead(motion_1);
if (sensor_1 == HIGH) {
digitalWrite(meter_1, HIGH);
delay(500);
digitalWrite(meter_1, HIGH);
digitalWrite(shutter_1, HIGH);
delay(100);
digitalWrite(meter_1, LOW);
digitalWrite(shutter_1, LOW);
delay (400);
digitalWrite(meter_1, HIGH);
digitalWrite(shutter_1, HIGH);
delay(100);
digitalWrite(meter_1, LOW);
digitalWrite(shutter_1, LOW);
delay (400);

}
}



thanks Casey this is great! I think i will add a few seconds delay after the last trigger to allow flash recharge (and prevent a new cycle going if the PIR gets signalled again).


Top
 Profile  
Reply with quote  
PostPosted: Fri Mar 09, 2018 3:08 am 
Offline
Fledgling
Fledgling

Joined: Tue Jan 02, 2018 3:29 am
Posts: 39
Location: England, UK
Casey- do you have any trouble with the Arduino?

i got the bootloader to work last time i programmed it, but i tried again last night and couldnt get the computer to recognise it/ bootloader to work.

any tips? im using a data cable and USB 2.0 port.


Top
 Profile  
Reply with quote  
PostPosted: Fri Mar 09, 2018 7:08 am 
Offline
Emperor
Emperor
User avatar

Joined: Tue Jun 17, 2014 4:24 pm
Posts: 745
Yes, at times the boot loader has failed to recognize the Arduino. Disconnect the cable and reboot computer. I think updates between uses may cause this to happen. Also, I have had 2 USB cables mysteriously stop communicating.

_________________
Casey

https://www.instagram.com/caseysmarttphoto/
http://www.caseysmartt.com


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ Array ]  Go to page Previous  1, 2, 3

All times are


Who is online

Array


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group