Hi, I am new here and a newbee to robots and programing. I have the basic starter kit and have the square bot built. I have two bumpers on the front and two on the back for full range wall detection.
My version of Easy-C is v1.1
I have read through the book, the help files, searched this forum, watched the 29 minute video here on the line follower robot with the arm, watched other vids, and searched all of google for about 7 hours now total. (= So far no answer to this question.
I found on person asking this here about two bumpers but all the answers to him were just to read books on C and learn the programing language. I would like to know how to do this using only Easy-C as I am just building this for a friend.
So far I have one bumper working…that was easy…just followed the book.
Any help here would be AWESOME! (=
Many thanks in advance,
Jay
Oh, also, is there any way my/his software can be upgraded to easy-c v2 without paying extra? Thanks. (=
while ( 1 )
{
bump1 = GetDigitalInput ( 5 ) ; // Left Rear
bump2 = GetDigitalInput ( 6 ) ; // Right Rear
bump3 = GetDigitalInput ( 6 ) ; // Front Bump
if ( bump1 == 0 || bump2 == 0 )
{
// Drive Forward
}
if ( bump3 == 0 )
{
// Drive Reverse
}
}
Good morning…er…afternoon…I first got it last night at 4:30 am. Thank you for answering. I see the code you have and it would work but I need it to be directional and then some. Also, I worked with || comands a lot at first and never could make them work…strange…hours of trying. && comands comparing values is what ended up working. Am I on the right track with that for directional?
I have added a “head” servo that looks in the direction of the collision as well and attached a simple plastic lobster for good looks. The bumper works perfectly all the way accross…even if it is impacted directly center!
Next I want to add smarts to it. Something like…forward…hit any bumper 5 times within 10 seconds…back up(sensing rear bumpers)…turn ~90(away according to which front bumper counted to five first)…go forward again…
I’d also like to add some randomly timed stop…look…turn events to add a sense of AI to it.
Is this asking too much of this robot?
Ok, here it is. I posted the program here https://vexforum.com/t/two-or-four-bumper-program-in-easy-c/14022/1 in post #6.
Any feedback on the bot or my program is welcome. For those who don’t know…the zip file is my program for two “bumper” directional turn sensing from Basic-C
Thank again.
(PS. Wow, I can’t believe how small images have to be to upload them. Save(if needed) and Open with Windows Picture and Fax Viewer and zoom in. Photoshop zooms without antializing so in this case WPaFV is better.)