Rank: Member
Groups: Registered
Joined: 7/15/2017(UTC) Posts: 10
Was thanked: 3 time(s) in 3 post(s)
|
I've built a telecine project with a modified projector and arduino, but the programming side needs doing and I'm stuck in Embrio. I can't seem to figure how to control the stepper motor. The custom arduino node doesn't have includes, declarations or setup inputs anymore like the older versions as shown on the tutorials on this site, so no idea where its supposed to go! I simply need it to: 1 - Start to turn motor when I hold down a switch 2 - Detects from a hallsensor when to pause 3 - Pause briefly and take a picture 4 - Continue turning motor and to step 2 And so on as a continuous loop until I release switch. Any help appreciated. Edited by user Tuesday, December 26, 2017 10:16:20 AM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 12/11/2014(UTC) Posts: 661
Thanks: 1 times Was thanked: 109 time(s) in 104 post(s)
|
Here are two videos about making nodes in version 2. I'm half way through updating the docs and videos for the changes from version 1 to 2. I'm away from my computer for a couple days so I can't create an example until I get back but I will try to give hints. Most of this should be pretty easy. An issue you might find is the stepper motor. I haven't used one for a while but I remember there was a little issue with timing and how embrio makes programs. I think if you search the forum for stepper you'll find some info. Your custom node should just control the stepper. All of the rest of the logic you'll want to do with nodes in agents. You'll want an agent to encapsulate the button. Probably just a digital input and an above or below node, exposing an output trigger on the above or below node. You'll want an agent to encapsulate the hall sensor. It will expose an activation or a trigger, not sure which you will need. Then you'll have some kind of control agent. When the button is pressed it will turn on a switch node. The activation of the switch node will turn on the motor. When the hall sensor fires or gets high enough it should turn off the switch. That's an overview. Let me know if you are stuck on anything and I will put together an example project in a couple days when I get back. Basically first get your components encapsulated in their own agents with just the useful inputs or outputs exposed, then do the main logic on a control agent. Make sure you've gone through the beginner tutorial videos. The interface has changed since they were made but the important concepts about agent based programming and how to structure a program in embrio are the same. Also, what do you mean by take a picture?
|
 1 user thanked EmbrioAdmin for this useful post.
|
|
|
Rank: Member
Groups: Registered
Joined: 7/15/2017(UTC) Posts: 10
Was thanked: 3 time(s) in 3 post(s)
|
Thanks will take a look at the video. As for "take a picture", I have a camera trigger switch on a pin on the arduino to take a photo when the motors paused. I'm doing a project similar to this: https://www.youtube.com/watch?v=50MSidTNwTI
|
 1 user thanked Bassquake for this useful post.
|
|
|
Rank: Administration
Groups: Administrators
Joined: 12/11/2014(UTC) Posts: 661
Thanks: 1 times Was thanked: 109 time(s) in 104 post(s)
|
Neat! Whatever the Arduino code to fire that camera trigger is you'll just want to copy in to a new node like in the video I sent, put that node on an agent, expose the input trigger that fires it, and drag that agent onto the main control agent.
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.