TinyCircuits Forum

TinyCircuits Products => TinyDuino Processors & TinyShields => Topic started by: SteveDorr on December 17, 2020, 01:14:24 PM

Title: TinyZero with Accelerometer & Wake from Sleep
Post by: SteveDorr on December 17, 2020, 01:14:24 PM
Hi,
I just purchased a Tiny Zero with the built-in accelerometer.  I would like to build a small app that goes into low-power mode and wakes up via an interrupt from the accelerometer if it detects significant movement.

I have the accelerometer working, but I'm looking for some sample code which puts it to sleep and codes the accelerometer to generate the interrupt appropriately.  From what I read people were soldering connections to make INT1 work on the proto board, but I'm wondering about the TinyZero which has it all integrated on the same board.

Thanks for your help.
Steve
Title: Re: TinyZero with Accelerometer & Wake from Sleep
Post by: HunterHykes on December 18, 2020, 03:05:33 PM
Hi Steve,

As can be seen in the TinyZero schematic (https://github.com/TinyCircuits/TinyCircuits-TinyZero-ASM2021/blob/master/design_files/TinyZero_Schematic_Rev5.pdf) and board files, the INT1 pin of the BMA250 accelerometer is only broken out to a solder pad on the bottom side of the board (https://github.com/TinyCircuits/TinyCircuits-TinyZero-ASM2021/blob/master/images/TinyZero_back.jpg). This is the small copper circle labeled "INT1" next to the "BOOT" button.

Because of this, a wire would have to be soldered to this pad and then input to the processor via a Proto Board TinyShield (https://tinycircuits.com/products/proto-board-tinyshield?variant=14984618887). According to the official Arduino documentation for interrupts (https://www.arduino.cc/reference/en/language/functions/external-interrupts/attachinterrupt/), any digital pin except for digital pin 4 is usable for interrupt input to the TinyZero processor.

If this is something you'd still like to pursue, I can look into getting some sample code for this.

Hope this helps.
- Hunter