-
Notifications
You must be signed in to change notification settings - Fork 670
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
Edits to EduMKII BP Examples #849
base: master
Are you sure you want to change the base?
Conversation
These edits make the code compatible across multiple boards with a few additional core file tweaks. They have been tested on the MSP432, MSP4305529, MSP430FR6989, and TivaC123
Thanks for the pull! Reviewing the code I see that you added analogReadResolution(12) to all Sketches. Note that not all LaunchPad's support this which will break the example Sketches for those platforms. Is there a specific reason to want 12 bit vs the standard 10 bit? I would rather see analogReadResolution(12) commented out and then add a comment stating that if you would like higher resolution on platforms that support to comment out that line. |
The example code was already written with 4096 as a maximum value when either mapping an analog value to an LED, detecting a direction of the joystick, etc. Since different boards were defaulting to different analog read resolutions (MSP432 was 10 bit while I believe the rest that I tested were 12 bit) the code examples with hard coded max values would break unless run with 12 bit resolution. I found it easier to just declare 12 bit as the default, especially knowing the G2 is incompatible with the EduMKII BP due to the 40 pin header. It can easily be changed to the default 10 bit, but this would either take defining the max value at run time dependent on the read resolution, or ensuring all boards were defaulting to 10 bit resolution and dropping the max values to 1024. |
As a solution, add a Very useful for mapping data.
|
@rei-vilo Are you saying create this function or is this something that already exists? I'm having trouble finding anything like this in energia documentation, but would be glad to try and put something together and then revise the eduMKII code to reflect this change. It would definitely help make the code more robust. |
@croberts15 The |
Added the functions to make is to the analog resolution maximum value didn't have to be hardcoded
I added a function in to get the current analog read resolution as well as a function to return the maximum value for the current resolution for all non-MT devices, but I can't figure out how to edit core files for the MT devices and have energia factor the changes in for testing. Any advice? |
These edits make the code compatible across multiple boards. They have been tested on the MSP432,
MSP4305529, MSP430FR6989, and TivaC123.
A change log can be seen below:
i. AccelermoeterLED
ii. AccelerometerSerial
iii. EduBP_MKII_Production_Test
iv. EduBP_MKII_Production_Test_Serial
v. GatorHoleBuzzer
vi. joystickDrawColor
vii. joystickSerial
viii. KonamiContra
ix. KonamiContraBuzzer
x. LCD_Joystick
xi. LCD_LifeGame
xii. MicophoneInLEDOut
xiii. ServoFromJoystick