I have thought about security device using LDR.
This is working principle of it.
1.It checks the resistance of LDR.
2.By using a resistance value, security device checks whether the light is on.(checking time interval: 1 seconds)
3.If the light is on > 1
If the light is off > 0 (usual)
4. loop this.
5. How to end the password: Automatically shut down when there isn't light for five seconds.
5. Get the password (ex: 10101, 100110)
6. export this password to computer.
Can anyone help with writing code?