Help with different commands

2 replies [Last post]
vaironl
vaironl's picture
Title: NooBot+
Joined: 04/09/2011
Posts:
BotPoints: 27
User offline. Last seen 10 years 22 weeks ago.

Sorry for the title, couldn't think of a better one.

Can someone give me some tutorials on how to update both bumpers at the same time. By the way is there a back bumper?

And how can I update and use Global variable.

if other complicated things might be useful please list them as well since this will be my second competition and I need useful things.

I already read the CBC_V2_manual and I can't understand it

Doing science.

Jeremy Rand
Jeremy Rand's picture
Title: Botball Youth Advisory Council
Joined: 04/03/2009
Posts:
BotPoints: 1168
User offline. Last seen 7 years 19 weeks ago.

If I understand correctly, you want an if statement to return true if either bump sensor is pressed? A logical OR operation will do this.

if(condition1 || condition2) // condition1 and condition2 should be set to the two bump sensors
{
// Do something here; it will happen if either bump sensor is pressed.
}

There is no rear bumper. The caster wheel has an encoder that can be used as a rear bumper, but accessing it requires a Create firmware hack (trust me, you don't want to attempt this). There are probably better ways of accomplishing what you want... are you trying to line up with a wall? If so, screw a horizontal bar below the rear of the Create, and just back up; you'll align without going over the wall.

I'm not sure I understand your question about global variables... can you elaborate on what you're trying to do?

-Jeremy Rand
Senior Programmer, Team SNARC (2012-2013), Norman Advanced (2010-2011), Norman HS (2008-2009), Norman North (2005-2007), Whittier MS (2003-2004)
2012-2013 VP of Tech, 2011 President, Botball YAC (2009-2013)
Mentor, Alcott and Whittier MS

vaironl
vaironl's picture
Title: NooBot+
Joined: 04/09/2011
Posts:
BotPoints: 27
User offline. Last seen 10 years 22 weeks ago.

Well I'm trying to do multiple things such as creating a cliff sensor , and other similar things.

Doing science.