• 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

    towlerg-21522

    PIC18F1330 PLL problem

    Thread Starter: rcurl

    I'm just starting out on a new project that uses a PIC18F1330. I haven't used this specific chip before, so I began by trying to blink an LED just...

    towlerg Yesterday, 16:26 Go to last post
    towlerg-21522

    Pic16f18877 oread

    Thread Starter: evoortman

    Hi, On a PIC16F18877 the OREAD command doesn't seem to work. The code is working on a PIC16F1939. Both controllers use 32MHz int osc. If i...

    towlerg Yesterday, 16:25 Go to last post
    palamont-28794

    MID$ Problem with a PIC18F25K22

    Thread Starter: palamont

    Hi everybody, I encounter a strange problem : I have a string of 230 characters. This string is divided into 10 segments of 23 characters, with a...

    palamont Yesterday, 10:08 Go to last post