Firmware support for RTR_520 with ESP32#272
Merged
Merged
Conversation
quentin-leboutet
requested changes
Mar 31, 2022
quentin-leboutet
left a comment
Collaborator
There was a problem hiding this comment.
The min and max functions need to be redefined so get it to build properly. Once this is done, I confirm that I can control the RTR_520 vehicle.
| const int PIN_LED_LI = 4; | ||
| const int PIN_LED_RI = 7; | ||
| //-------------------------RTR_520----------------------// | ||
| #elif (OPENBOT == RTR_520) |
Collaborator
There was a problem hiding this comment.
I need to redefine the min and max functions to get it to build:
#define max(a, b) \
( \
{ \
__typeof__(a) _a = (a); \
__typeof__(b) _b = (b); \
_a > _b ? _a : _b; \
})
#define min(a, b) \
( \
{ \
__typeof__(a) _a = (a); \
__typeof__(b) _b = (b); \
_a < _b ? _a : _b; \
})
Collaborator
Author
There was a problem hiding this comment.
This should be fixed now with the fix below.
| const float US_TO_CM = 0.01715; //cm/uS -> (343 * 100 / 1000000) / 2; | ||
| const unsigned int MAX_SONAR_DISTANCE = -1; //cm | ||
| const unsigned int MAX_SONAR_DISTANCE = 300; //cm | ||
| const unsigned int MAX_SONAR_TIME = MAX_SONAR_DISTANCE * 2 * 10 / 343 + 1; |
Collaborator
There was a problem hiding this comment.
As discussed with Matthias, an alternative solution consists in changing this line to:
const unsigned long MAX_SONAR_TIME = (long)(MAX_SONAR_DISTANCE * 2 * 10 / 343 + 1);
Collaborator
Author
There was a problem hiding this comment.
Updated as discussed.
quentin-leboutet
approved these changes
Apr 4, 2022
lacykaltgr
pushed a commit
to satinavrobotics/SatiBot
that referenced
this pull request
Jun 1, 2025
Firmware support for RTR_520 with ESP32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.