Hello guys.
I am working on a project with Arduino diecimila and Adobe Director. I have a bar in the game which I want to be moved with my interface. The interface is also a bar that looks like a T. The goal of the game is to balance some balls on the bar by moving it left and right --> example Google - Balance Balls.
I don't want to move the bar with the keys on my keyboard but with my interface. So I have a DistanceSensor on it, which should read the distance to a plate. I don't know how can I put the values of the sensor which is connected by Arduino to the Game?
Does anyone of you know a Lingo command?
I have another example which was made by my teacher, but this isn't with a bar but with a quicktime movie of a sun. When the distance of the sensor is on a certain amount the sun rises, when it is on an other amount the sun goes down. Unfortunately I can take his code because he has a movie and I don't.
Here is his director code:
property pAnalogRange, pAnalogMin, pFactor
on beginSprite me
pAnalogMax = 300
pAnalogMin = 45
pAnalogRange = pAnalogMax - pAnalogMin
pFactor = (sprite(me.spriteNum).duration*1000/60)/pAnalogRange
end
on serialDataChanged me, data
sprite(me.spriteNum).currenttime = (data - pAnalogMin) * pFactor
sendSprite(me.spriteNum, #setRequestData, TRUE)
end
I don't need the duration but the value of the sensor
Thank you very much.
Greets,
tanja