-
Notifications
You must be signed in to change notification settings - Fork 0
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
FWT-11 #2 hallelujah effect sensor #1
base: main
Are you sure you want to change the base?
Conversation
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.
Thank you Oleg very cool
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.
Some minor comment changes but I don't wanna rereview so I trust you'll do them
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.
Some more to do
will need to redo as I require a GPIO IRQ Handler |
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.
A couple comments 🐸 🐸 🐸
…work in isolation
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.
Looks pretty good, just a few changes. Please remove the cmake-build-debug directory and make sure your build directory is set to 'build' in the CMAKE options. Also please update the README to describe the purpose of this repository. Also include the target device and the name of the main board target (REV3-WSS).
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.
A lot of nitpicks, but the overall structure is pretty good.
Also, be sure to test this thoroughly. This driver is written assuming that we'll be able to poll the GPIO fast enough not to have issues, but that's not a great assumption to be making. If this isn't working, we may have to investigate an interrupt-based solution
…or' into feature/ol2764RIT/hallEffectSensor
…or' into feature/ol2764RIT/hallEffectSensor
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.
Looks pretty good, just a few small things. Also don't forget to go through the unresolved comments and mark them. Once you have all of that, lets do one final test before merging.
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.
Looks much better than it did before, but there's a little more cleanup to do
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.
A couple nitpicks, but otherwise looks good to go
enum class WheelSpeedState { | ||
STOP, /** Wheel is not moving */ | ||
INITIALIZING, /** Setting speed based on first reading */ | ||
MAINTAIN, /** Wheel is spinning at a constant speed or speeding up */ |
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.
Could be constant, speeding up, or slowing down
MAINTAIN, /** Wheel is spinning at a constant speed or speeding up */ | |
MAINTAIN, /** Wheel is spinning */ |
MAINTAIN, /** Wheel is spinning at a constant speed or speeding up */ | ||
}; | ||
|
||
/** Constructor (take a GPIO instance and the radius of the wheel) */ |
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.
Update this comment and make it match our normal standard
uint32_t lastInterval; | ||
/** Current state of the wheel */ | ||
WheelSpeedState state; | ||
/** Flag to check if the sensor is high */ |
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.
In your comments and variables, you should talk about the magnet being detected or not detected. If we get another hall effect sensor that's active high instead of low, we don't want to have to go through and update all the comments. The value of MAGNET_DETECTED_STATE
should be the only way to know if the sensor is active high or low
bool magnetDetected = false; | ||
if (magnetReadLow && magnetInLastRead != magnetReadLow) { | ||
magnetDetected = true; | ||
} |
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.
This is entirely stylistic, but I would recommend this
bool magnetDetected = false; | |
if (magnetReadLow && magnetInLastRead != magnetReadLow) { | |
magnetDetected = true; | |
} | |
const bool magnetDetected = magnetReadLow && !magnetInLastRead; |
/* | ||
* The speed of the wheel in revolutions per minute. | ||
* lastInterval is the time that it takes for one full revolution of the wheel | ||
* in milliseconds, so converting that to RPM is just dividing 60000 by lastInterval. | ||
*/ |
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.
Update this comment
Created the very new hallSensor class
-Goes through a GPIO read and assigns the correct case
-returns time
-returns distance traveled and speed
Created main for WSS using hall effect sensors
-Created representation of WSS using two hall effect sensors for back and front wheels
-Allow can transmission of data for validation of proper functionality