I have just shared content in Guides > PiicoDev: “PiicoDev 3-Axis Accelerometer LIS3DH - Getting Started Guide”
Read more
Loving the new unified guide format to match the unified python libraries. Super handy if you might be prototyping on one device before switching to another.
Hi @Michael
A suggestion for the shake demo code to make the output more ‘visible’
The original loop
while True:
if motion.shake(threshold=15):
print("shaken!")
else:
print("")
# shake() is blocking, so can be used instead of sleep_ms() to delay a loop.
my updated loop
while True:
if motion.shake(threshold=15):
print("shaken!")
else:
print(".", end="")
# shake() is blocking, so can be used instead of sleep_ms() to delay a loop.
and some sample output
...............shaken!
.......shaken!
.........shaken!
....................................shaken!
..shaken!
cheers
Murray
p.s. been playing with new toys from the Borg article credit note - thanks
Hi Murray,
It’s not the conventional scroll most people are used to seeing from a terminal window, but I like it!
I’ll probably use your format in my own projects even if it doesn’t become the PiicoDev example standard.
Glad to hear there’s already a new project in the works after the Borg cube, keen to see what you make next.
Hi Trent,
I added that bit because with the scrolling, and practicing to get the right amount of ‘shake’ I wasn’t sure what was happening. Fast scrolling ‘blank’ lines and trying to catch a activity message drove me slightly bats…t I don’t mind seeing ‘null report’ mesages - it at least lets me know that the process is doing something!
Murray