Tuesday, February 28, 2017

Spring 2017 Week 5

This week, I was able to meet up with the software/mobile application team in order to ask them for help with the code. As expected, instead of putting all the functions into a while loop that also contains the pathing, Tim and Johnny on the software/mobile application team suggested that I try a different method. Fortunately, they were kind enough to help me with that, and came up with the idea of using stack arrays instead. 

Therefore, I was able to learn both something new and useful because I was able to get the pathing code working as it did before, but this time by using stack arrays and without blocking other code. I would post the code onto here, but it would be extremely long because it involves a lot of nested functions in order to accommodate all 12 paths that are possible on the track. However, the code works by creating a stack array based on the path assigned to the pod car only if the stack array is empty and a path is given. Then the pod car would switch (or not switch) based on the values in the stack array (0's and 1's) and pop off the end value of the stack array every time the pod car detects a magnet. 

Now that we finally have a method of pathing without blocking all other code, we are ready to integrate all our functions together. Hopefully, there will be little to no issues during integration even though it is very unlikely.

No comments:

Post a Comment