being a noob is no excuse... think about what it means to avoid an obstacle first, what the microcontroller needs to know, how it's going to know it, and what should it do with the information currently known by the microcontroller.
learn C, this is stuff you should be learning in high school anyways