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

Add Arduino binary literal syntax #171

towynlin opened this Issue Apr 7, 2014 · 3 comments


None yet
4 participants
Copy link

towynlin commented Apr 7, 2014

Issue raised in hardware repo belongs here.

In Arduino you can define binary values with B, e.g. "B10011".

See code:

use case:


This comment has been minimized.

Copy link

gruvin commented Apr 22, 2014

Neutral comment: Since we're using GCC, we can just use its included syntax, 0b01010 for binary literals. That requires the 'B' in existing Arduino code to be changed to '0b'. But that doesn't seem so arduous (no pun on 'Arduino' intended! :-P)

(I was not aware until just now that this is a GCC special thing.)


This comment has been minimized.

Copy link

m-mcgowan commented Apr 21, 2015

Unfortunately, this is a (non-standard) feature of the avr compiler, that isn't supported in gcc, so supporting this is not possible unless we preprocess all source files (no small undertaking.) The ideal fix for this is to document the different syntax. cc: @kennethlimcp

@m-mcgowan m-mcgowan closed this Apr 21, 2015


This comment has been minimized.

Copy link

technobly commented Feb 7, 2017

Implemented in #1191 released in 0.6.1-rc.2.

m-mcgowan added a commit that referenced this issue Oct 30, 2018

Merge pull request #171 from particle-iot/feature/ch18896/network-reg…

Implements Mesh Network Registration commands in the communications l…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.