Close

Bits and bit order

A project log for Tiny Bit Machine

An 8-bit solar powered gadget.

gordonGordon 08/13/2024 at 19:230 Comments

Got the reversed bit issue figured out. I was starting at the wrong end of byte while saving and loading.

But in the process I changed how editing and saving bits works. Instead of loading the byte into an array

int8_t bits[8];

 Then editing bits in array before saving, toggling a bit will now directly and immediately set that bit. This will save 8 bytes of global memory we may need later.

Also if we want to blink out all the bits from a byte, it just reads 1 bit at a time, instead of first loading byte to bit array then looping through that array.

Discussions