-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closes #195: Create A Driver for URM04 Sensor #232
base: master
Are you sure you want to change the base?
Conversation
Can you include a link to the URM04 reference page? |
please have meaningful PR titles |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey i left some comments.make sure to take advantage of vs code's replace all functionality to implement some of the changes like prefix private members with m_
Orson and I found this driver that is much cleaner than the arduino code. seems to have less random waits and better defined functions. I think orson wil try and replicate this driver moving forward: https://github.com/vrxfile/ultrasonic_rs485_sensor_api/blob/master/main.cpp |
Sample Code for URM04Sensor This Fourth Commit follows the 'Sample Code for URM04Sensor' the code makes a lot more sense and is easier to understand. |
In this commit I added writing high or low to the trig_pin because apparently this is needed to trigger the reading mode and transmitting mode for the RS485 interface as seen in this documentation here. Just want to make sure that this is correct ? |
…cs/MarsRover2020-firmware into orson/createURM04Driver
…cs/MarsRover2020-firmware into orson/createURM04Driver
…cs/MarsRover2020-firmware into orson/createURM04Driver
…cs/MarsRover2020-firmware into orson/createURM04Driver
@cindyli-13 finished implementing the requested changes. After resolving some git issues. |
URM04Sensor::URM04Sensor sensor(D2, D0, D1); | ||
float distance_cm; | ||
while (1) { | ||
sensor.read_distance(distance_cm); // measurements returned in Centimeters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@younesr1 Is it ok if the ultrasonic sensor read is blocking?
The serial was not being flushed properly as it was being called after function returned. Thus, I moved it before function returns.
…cs/MarsRover2020-firmware into orson/createURM04Driver
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm! Were you able to test the sensor with the nucleo? We should also probably confirm that the blocking read call is acceptable for our purposes.
This is working version for the urm04 driver