Hi everyone.
I am recently doing a school project which the title is Automated Locking system.
The project consist of :
Arduino UNO
Accelerometer ADXL 345
Electric LOCK
The project is such that at a range of value of X, Y and Z of the accelerometer, i want the eletric lock to lock by itself and at a given range it unlocks automatically.
Eg. if(X< 200)
electrick.lock is unlock
else if (X > 200)
electric lock is lock.
However I am having some trouble with the sketch of how to write it.
I would really appreciate if anyone can help me.
Best Regards