This code allowed us to see if we got the correct readings out of our buttons. With 12 buttons going into our breadboard we had to make sure all connections were correct. These buttons were going to be used for orienting at that start, but for legal reasons we scrapped it and used ultrasonic sensors to orient. A single button was left to differentiate between arena A and B.
Here we tested to see if we would get the expected readings out of our ultrasonic. We found out that we had to be careful with angled bounces off the walls which would give inaccurate readings with the ultrasonic sensors. The ultrasonics worked best when facing a wall head on, giving us the most accurate readings.
This component test was important to figure out what the different thresholds were between the white arena flooring and taped black lines. We also learned that we might need to tweak the threshold based on how/if the sun is hitting through the windows of d.school (where the testing was conducted).
This code allowed us to test the different PWM of our motors. Through some extensive testing we figured out that no matter how much we tweaked each motor, we would not be able to make our robot drive straight without hardware change.
In this piece of code, we wanted to test our theory of making our robot drive straight based on the readings of the two front sensors. If we would be facing perpendicular to a wall, we should get equal or similar reading. When the difference bewteen the two were above a certain threshold, we would increase the PWM of the respective motor to straighten it out. The results were great. For future work, we can smooth it out by implenting a proper PID controller based on these inputs/output
This simple piece of code would be used at the end of our run to release the balls out of the slide to score points and celebrate at the end. When implementing it with our base code at the end we learned that it has a weird effect on what pins it takes over, and could mess up the PWM pins that your motors are using. Please set an adequate amount of time before checkoff in implemting your Servo Motor code with base code. You might have to change the whole hardware configuration of ur pins to get it properly working.
This code allowed us to get checked-off! We got our ultrasonics to help us drive straight when they were able to get adequate readings and get our timing right to bring us to the contact zone, deliver our DARTS, and celebrate after!