Archive for the ‘Flash trigger’ Category
-
Flash trigger code v0.1
There it goes, version 0.1 code of the Arduino controlled flash trigger:
int val=0; // To store the value from the LDR int laserPin=12; int redLed=8; int flash=10; int greenLed=13; int ldrPin=0; bool aligned=false; bool lastAligned=false; bool beamBroken=false; void setup() { pinMode(greenLed,OUTPUT); pinMode(redLed,OUTPUT); pinMode(flash,OUTPUT); } void loop() { // Laser/LDR alignment val=analogRead(ldrPin); if(val > 200) { digitalWrite(greenLed,HIGH); aligned=true; } else { digitalWrite(greenLed,LOW); aligned=false; } // Broken beam? if(lastAligned!=aligned && aligned==false) { // Alignment has changed or beam broken beamBroken=true; } else { beamBroken=false; } if(beamBroken) { digitalWrite(laserPin,LOW); // We probably need to put a delay here, to allow // the laser to turn off before the flash triggers digitalWrite(redLed,HIGH); digitalWrite(flash,HIGH); delay(10); digitalWrite(flash,LOW); delay(1000); digitalWrite(laserPin,HIGH); digitalWrite(redLed,LOW); delay(200); // Wait some time to allow the LDR // to stabilize after laser off/on // to avoid false positives. } digitalWrite(laserPin,HIGH); lastAligned=aligned; } -
Flash trigger update
Hi there, I’ve uploaded the code of the flash trigger project and the schematic (made with gEDA, by the way), in case you feel like making it for yourself (don’t forget commenting back if you do so).
Hope it’s useful.
Next I’ll try to improve the connections to the laser and to the flash, as they are too much in prototype status, and the whole system needs to be robust if I pretend to use it in real life situations… And I do
Categories
- Ambilamp (5)
- Flash trigger (2)
- General (4)
- Photography (1)
- Projects (2)
- Robotic arm (4)
- Robotics (1)