Friday, February 21, 2020 at 23:39:00 UTC
Playing with a cheap accelerometer from eBay.
It's kind of a PITA device. It uses TWI, which the ATmega328 supports, but only in that it has a hardware register that lets you do it on a byte-wise basis rather than a bit-wise basis. You still have to write a lot of code to make the TWI work. Then this chip isn't very well documented, and its more advanced features aren't even available because you have to load code into the chip to implement them, and of course that process is undocumented and the code is unavailable.
However, it does tell you how much acceleration it's experiencing on 3 axes, and also tells you about rotational acceleration on 3 axes. I guess if I was smart I could put this data together and use it to figure out how the chip is moving in 3D space, but I haven't tried to figure that out yet. In this it's just taking the acceleration data from two axes and using it to figure out which way the chip is facing.