Tom's December Blog
- Tom Hall
- Jan 17, 2020
- 1 min read
My main goal for December was to have two functioning touch bars that would manoeuvre the micro mouse if they were activated. The touch bars are considered digital inputs because of this there are four possible options that need to be coded for both on, both off, left on only, and right on only.
If both touch bars are off this means that the mouse is not touching anything, so in this case it should be going forwards as fast as it can. If the left bar has been pressed only the left has collided with an object so the mouse needs to reverse away from it and turn itself away from the object, if it’s the right bar the mouse will do exactly the opposite. If both bars have been pressed it means the mouse has collided head on with an object so it must reverse away from it and pick a new direction to travel.
The touch bars are connected on Port C0 and C1, in the code these are called PTCD_PTCD0 and PTCD_PTCD1 respectively. By default both are one and when pressed change to zero.
A repeated problem that I have been facing is the position of the touch bars; it is difficult to position them in such a way that they can collide with obstacles in the path. When it comes to designing the chassis it would worthwhile making a better mount so they can have easier access to the obstacles.
Comentários