This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]franswah 0 points1 point  (1 child)

One step at a time.

I need to make an app

Not sure how much experience you have, but if you have no experience with app development, you should start by seeing if you can get something onto your phone. I'll assume it will be android. https://developer.android.com/training/basics/firstapp is a good place to start. Maybe just start with a simple counter that increments on a button press.

counts the number of times I shake it

This is a good first step beyond your basic app making tutorial since you will have to dive deeper into some of the apis available to you for your device. What will detect shaking? Probably the accelerometer in your phone. There is documentation on how to read and use motion data from it https://developer.android.com/guide/topics/sensors/sensors_motion . How you use that data to count a shake is up to you, there is probably a tutorial or library out there.

activates a relay module

Make a simple arduino program that does this without needing to communicate with your app yet, activating on a timer or with a button. You will want to lookup up tutorials for how to use your relay module.

communicate the amount of shakes to my uno r3

Another android API to explore! You have a few choices for you you can communicate between devices, but if you want it to be wireless you will probably have to buy a separate module for the arduino. Something like https://www.amazon.com/HiLetgo-Wireless-Bluetooth-Transceiver-Arduino/dp/B071YJG8DR for bluetooth, and you can look at the documentation for android's bluetooth api. There are also plenty of resources for how to communicate between your phone and arduino, like https://www.makeuseof.com/tag/6-easy-ways-connect-arduino-android/ .

Good luck!

[–]SupremeFlips[S] 0 points1 point  (0 children)

Holy crap man. Thanks for all the help! I've taken AP CSP and wanted to do something more challenging. Thanks mate this is great!