Tuesday, November 14, 2017

Module 11

Google Docs:

Nick:

https://docs.google.com/document/d/1ZP_R_GL6SBQs7kwvQo82SayEn7mNsTCHINMRf8AvCyQ/edit?usp=sharing

Charlie:

https://docs.google.com/document/d/1zgpNH0SF6dn-irOm2r72D5QG5DD8ZAUj-2pWsKvuYjg/edit?usp=sharing

David:

https://docs.google.com/document/d/1lYoljTasdxwgLQ9HQY3LMlcKqu7U0e28oze9fz3uNog/edit

Marlon:

https://docs.google.com/document/d/1i1FIrJP93EXfV4aB8WMsRhk7WnvNDtAs9zXSlTX3LE0/edit?usp=sharing




This is a final snapshot of our code for our SHUmo bot.

The code works like this:

When the program starts, there are four independent processes that begin. One lowers the arm and raises/lowers it whenever the touch sensor is triggered. Another just makes some sounds and sets the mindstorm image to be dizzy eyes. The third makes the light flash on and off in the red color. The last actually does the movement.

The actual thread starts by turning to the side to avoid anything that charges straight-on. Then, it checks to see if it's on a white line. If it is, then it backs up and continues. Otherwise, it checks to see if it's charging at a robot (boolean value "forward"). If yes, it continues charging. If no, it checks to see if it sees something on its IR sensor. If it does, then it turns around, starts charging, and sets "forward" to true. If it doesn't, it rotates. Then the loop restarts.

This should make it so that the bot starts by sidestepping, then rotates until it sees its opponent. Then it charges until it reaches a white line, and if it hits its opponent, it attempts to lift it using the arm installed.

No comments:

Post a Comment