top of page
Search

Week 12 - September 26 - October 2

  • Writer: Group Work
    Group Work
  • Sep 30, 2021
  • 1 min read

During our group meeting this week, we began with our usual task of catching each other up with each group members progress and discussing what next steps will be taken. Next, we got to work on the program for the primary micro-controller board. Figure 12.1 shows the section of the code that we were experiencing problems with.

Figure 12.1 - If-else statement for movement

The problem we were having was with the length of time it took in between readings of the ultrasonic sensor. The way it was set up previously, the sensor was read, and then as long as it was clear then the rover would start its move sequence. It was taking about 2.5 seconds for the code to go back and recheck the sensor, and in that time period the Rover could have already run into something. We decided that we could include reading the sensor with the section of code that is continually reading the RSSI value. This way, the sensor is always being read in the background as well.

The next problem we had to work out is how the rover will turn when it is getting colder. The question was what if the Rover is getting colder, so it turns left, but then it is still getting colder? We decided to include a counting variable within a loop to count how many times the Rover turns in its search for a stronger RSSI signal. We also adjusted the if-else statement in figure 12.1 to be more concise. The else command will now be forward, and each statement will only state if, not else if.

 
 
 

Comments


bottom of page