Tried out a couple of infra red sensors, and managed to find one with a capacitor built in which made the results more accurate. The arduino can now pick up readings from up to 50cm away. Perfect!
Attached a lillypad vibe sensor as the output, when the threshold is above a certain nominal value, the vibe comes on. This fits in well with the original mole concept:
This is the program I wrote in Arduino for the set up:
For anyone who doesn't understand the jargon, to simplify it:
Part 1: Setting up the parameters and the threshold value (the value the vibe will be activated)
Part 2: The void setup, letting the software locate where the vibe is located
Part 3: The actual program, called a loop
part 4: Conclusion, if the value is above the threshold, turn the vibe on
if the value is below the threshold, turn the vibe off
No comments:
Post a Comment