Asked — Edited

How Do You Play Mp3 When Photosensor Detects Camera Flash?

I'm going to be buying the ez robot kit and using a 10" windows 7 tablet to run the system which will be attached to the robot.

Everytime the camera flashes I want the robot to say something cheesy like work it you look sexy smile you're such a tease etc.

What would be the easiest way to accomplish this and where would I get a photosensor? I know I can buy them for cameras, but not sure if the photo studio kind would work wtih the ez-robot kit.

Or perhaps there is a way to integrate it into the PC so the PC is doing the triggering and processing via a script like autohotkey.com perhaps a usb to serial adatper cable hooked into the sensor that opens a random mp3 file, that sounds way too complicated to program confused

anyways looking for the easiest way, I dont' care if it is too expensive.


ARC Pro

Upgrade to ARC Pro

Stay at the forefront of robot programming innovation with ARC Pro, ensuring your robot is always equipped with the latest advancements.

United Kingdom
#1  

There are a few ways to do it.

One way would be to fit a photosensor, connect it up via the ADC port so that when the light is bright it returns either a high or low figure (depending on which way round the sensor works). Not a clue which sensor to use but someone else may do.

Then have an EZ-Script to read the ADC port and play a random MP3 when it's detected it's high. Something like;


:start
ADC_Wait(adc0, higher, 200)
MP3TriggerPlayRandomTrack(D0, 38400, 1, 10)
Goto(start)

Bearing in mind the code is very crude and not well thought out at all. It assumes the sensor is on ADC0, a flash causes the sensor to read >200, the MP3 trigger is on D0 and has 10 tracks on it.

#2  

most photo sensors has a analog output,plus very easy to make and add. on the autokey,on a project someone else made ,he has hotkey example will find his post.

trying to find a usb adapter to use a photo sensor going to be very hard,main reason it will need a cpu and then a c++ program and DLL file to make API calls to it.

second when a camera flashes the sensor wont have enough time to to turn on MP3

so what you need is to tap in the circuit before it flashes,or if the camera has a second flash that takes the photo.

best part is where is recognizes people ,it where you make tap point.

i guess i can buy the camera interface for the camera,and hack it for a connection

United Kingdom
#3  

Just an idea which you may or may not like but the camera control can detect faces and that can run scripts... so when it sees someone it'll play a sound...

Add in an EZ Kit camera along side the camera taking photos, or any camera (doesn't need to be the EZ kit one), run a script which plays a random mp3 on face detection.