• PicŪ Basic


  • 4 digit Keypad Number entry converted to a Word variable?

    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.
    This article was originally published in forum thread: 4 digit Keypad Number entry converted to a Word variable? started by Grant34 View original post
  • Recent Activity

    Les-15

    Num_Byte on 18F26K42

    Thread Starter: towlerg

    I'm using a macro that was created by the generator Dump Macro P1 #if (Prm_Count > 1) #error "Dump - Too many parameters" #else ...

    Les Today, 17:17 Go to last post
    John Drew-26

    Fault in bit wise comparisons on release 3.6.1.2.

    Thread Starter: kbaykar

    Hi Les, I just downloaded the release 3.6.1.2 today and seeing that it supports 18F47K40. I am trying to port my code from 18F4685 to 18F47K40. ...

    John Drew Today, 13:41 Go to last post
    SimonJA-751

    Hx711 calibration

    Thread Starter: amod

    Iam using load cell amplifier HX711 module.I have got raw values from module but iam not able to calibrate with load cell.I want make a universal...

    SimonJA Today, 07:38 Go to last post