-
Notifications
You must be signed in to change notification settings - Fork 0
1stprototype #3
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
base: main
Are you sure you want to change the base?
1stprototype #3
Conversation
|
Looks good. Onto file management. Rename gyro.cpp and gyro.h to imu.cpp and imu.h respectively. |
|
Move these lines to imu.h and change the comments to however you like |
|
Any code not listed here can be removed from main.cpp and not replaced in imu.cpp Create a global variable in imu.cpp but there is no need to declare it in imu.h
Declare a begin() function in imu.h and initialize it in imu.cpp with the imu related code in setup() |
|
The point of adding these next methods is that if we want to move away from the library and use our own custom methods, we can do it with minimal changes by modifying code within them Declare in imu.h and initialize the following wrapper methods in imu.cpp: imuReadGyro(int *x, int *y, int *z), imuReadAccel(int *x, int *y, int *z), imuGetEvent(int *accel, int *gyro, int *temp) |
|
Update main.cpp to only call methods defined in imu.h
|
first prototype