There were actually two problems going on, and I think I've figured out what they were, although I can't know until next class! (I don't have a Nikon camera like the students are using).
Here are the solutions, so they can be solved easily in class next time:
Before putting the NikonIRCamera folder anywhere at all, we need to edit a line of it, because it was written years ago, and it imports a file that now has a different name. At the top of the nikonIRControl.h file, it says:
#include "WProgram.h"
This file has been renamed Arduino.h, so I had to change that line to say:
#include "Arduino.h"
Because I'm such a loving teacher, and I don't want to deal with this problem on Tuesday, I'm attaching the modified file for download here.
The next problem we were having was "where do we put the files so Arduino can import them?" While I've done this lots in other languages, I was surprised to learn that Arduino requires us to put those files in a couple unlikely places. First of all, you need to make an "Arduino" folder in the "Documents" folder, and then put a "library" folder inside of it, in case you don't already have one, which you don't.
Next, and I think this was the more important one, you need to also put the file INSIDE of Arduino itself, like this: Right-click the Arduino program, select "Show Package Contents," and navigate to Arduino>Contents>Resources>Java>Libraries, and put a copy of the NikonIrControl folder in there too.
From there, all you need to do is paste this at the top of your project:
From there, all you need to do is paste this at the top of your project:
#include
and call the cameraSnap(CameraIrPin) function whenever you want to take a picture. For example, if you had your IR LED on pin 13, you could say:
cameraSnap(13);
Having looked up our IR LEDs, it looks like you should put a resistor on this LED of approximately 270 ohms.
I think that should be enough wrap-up notes for now! Let's hope this works on Tuesday! Otherwise, we might need to make something else motion-activated!
No comments:
Post a Comment