I am controlling a door latch with a 16F870 and MOSFET. (I am fully documenting this and will look to post when all together)
I currently have a static variable LatchTime hardcoded.
I am in the process of converting this code to allow the LatchTime to be a user variable entered via the keypad. I have thought about the process and wanted to see if anybody had come up with a simple and efficient process or is this the way?
Example code to illustrate the theory (Not tested: as at work - Lunch Hour)
Dim Key1 as Word
Dim Key2 as Word
Dim Key3 as Byte
Dim Key4 as Byte
Dim LatchTime as Word
Key1 = Key1 * 1000
Key2 = Key2 * 100
Key3 = Key3 * 10
Key4 = Key4 * 1 ' Not required, but for illustration
LatchTime = Key1 + Key2 + Key3 + Key4
Latch High
DelayMS LatchTime
Latch Low
and also record this in the internal E2Prom.


Menu
Recent Articles


Using PDS with SPI GLCD based on ST7565R Controller
Graphic LCDs based on the ST7565 are cheaper then GLCDs with other controllers. SPI requires only four pins. If the circuit