- I added the C-motor to see if the program ended where I wanted it to.- The two "Logic 1" blocks at the end of the top loop writes "false"- To make the count function work with the ultrasonic sensor, I added a "wait for Sensor > 22 cm"- The loop for the count-function is 6 seconds.- The "Greater than or equal" block says that "number 1" should be greater than 0.

It works perfectly. I tested it multiple times.Would be awesome seeing it in RobotC though to get the language refreshed

Thu Nov 29, 2012 2:57 pm

Flagstang

Rookie

Joined: Sat Mar 12, 2011 12:22 pmPosts: 17

Re: Need help programming simple function

Perhaps I should mention what I need to have done.

Imagine a transport belt and a visio camera. The belt drives a bottle into a chamber were it gets registered by the camera. If the bottle is broken or in any other way damaged, the belt will drive the bottle out of the chamber the way it came.

There's a sonic sensor sitting at the entrance of the chamber registering bottles. After 8 seconds, the bottle should either have stayed in the chamber or not. If the bottle stays in the chamber, a couple of motors will control the doors to the chamber. If not, nothing will happen and the program starts from the beginning once again.

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum