• My project consists of espruino, environment sensors and 4 blue 7 segment displays

    Datasheet(specifically decimals): https://github.com/sparkfun/Serial7SegmentDisplay/wiki/Special-Commands#decimal

    What I would like to accomplish is send data, for an example send the room temp, i.e. 76.7F to the 7-segment display. Depending on where the decimal place is, turn on that decimal which I dont think is that hard to do. What I am struggling with is calculating the bytes to send in order to turn on the specific decimal.

    To better understand this i will use the github totorial for my example. For example, To turn on the colon, apostrophe, and far-right decimal point we need to set bits 4, 5, and 3, respectively. Our data byte will therefore be: 0b00111000 (ie. hex 0x38, or decimal 56).

    From experience, I know the 0b signifies the data following is in binary format and 00111000 equals 56. Where did the 56 come from? There's a handy chart explaining the bit layout, however I still don't understand.

About

Avatar for d0773d @d0773d started