Skip to content
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

compile error with IDE 1.8.19 for MKRZERO warning: 'B00000000' is deprecated: use 0b00000000 instead #1

Open
adewdney opened this issue Apr 1, 2022 · 3 comments

Comments

@adewdney
Copy link

adewdney commented Apr 1, 2022

I would like to use the <MCP4251.h> library for a project using Arduino: 1.8.19 (Windows 10) and an "Arduino MKRZERO" for simulating NTC temperature sensors, using the 100kOhm version. However, when I try and compile the basic example provided, I get a large number of errors, such as:
..\Arduino\libraries\MCP4251\src\MCP4251.cpp:49:20: warning: 'B00000000' is deprecated: use 0b00000000 instead [-Wdeprecated-declarations]

 byte cmdByte = B00000000;

see attachment for complete list.
MCP4251_compile_errors.txt

@kulbhushanchand
Copy link
Owner

Thanks for reporting the issue.

This looks like warnings due to change in the format of binary literals.

I'm not getting any warning when compiling for Arduino Uno, however for MKRZERO I'm getting some different error.

For the time being, I suggest you to change all the binary literals in "MCP4251.h" and "MCP4251.cpp" files to the suggested format. Usually these installed library files for MCP4251 are at C:\Users\<Replace this with username>\Documents\Arduino\libraries\MCP4251\src

@adewdney
Copy link
Author

thanks for the tip, sorry I was not able to get around to trying it earlier. Replacing all the B formats to 0b in both the .h and .cpp files as well as the example program itself has cured the problem. There are no compile errors whatsoever now.
Thanks for the help
Andrew

@kulbhushanchand
Copy link
Owner

You are welcome and thanks to you too for reporting the results.
I'll soon make the necessary changes to the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants