• 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

    teo-16018

    Microsoft security essentials blues

    Thread Starter: shantanu@india

    Hi, A strange thing happened just now.My Windows 7 Micrsoft Sercurity Essentials suddenly gave a warning that prplus.exe(Compiler) is a potential...

    teo Today, 19:23 Go to last post
    pic-ignorant-1162

    Proton Runtime Error

    Thread Starter: Paulcc

    I have proton running well on my laptop, but after installing it on my desktop, I get the following runtime error: "Runtime Error 217 at 000709FC" I...

    pic-ignorant Yesterday, 22:11 Go to last post
    David Barker-251

    UMC bootloader 18F46K22

    Thread Starter: shunt010

    Hi all. I am trying to build a UMC bootloader file for the 18F46K22, and it doesn't appear to work. It returns (in the error log) Error ...

    David Barker Today, 11:20 Go to last post
    barak-1433

    SPI mssp

    Thread Starter: picprotonguy

    Just ordered Digital to Analog IC MCP4822 with SPI interface and immediately opened proton manual. I'm very disappointed, it looks like Proton...

    barak Today, 16:06 Go to last post