logo
down
shadow

PIC in C - creating own keypad scan routine using RC0-3


PIC in C - creating own keypad scan routine using RC0-3

By : George Edward
Date : November 19 2020, 03:59 PM
I think the issue was by ths following , In the previous question you linked, the "1,2,4,5" refer to the keypad legends which might be anything and often bear no relation to the bit values you receive back. You write a "1" bit to each output (row) in turn (or a "0" for inverted logic) and look for high (or low if inverted logic) bits on the column inputs. You worry about what is written on the keytops afterwards, by using a lookup table. Whether you have a 2x2 key matrix or a 4x4 is irrelevant, unless you want an in-line solution and not a looped one.
If the keypad really was 2x2 it would not need to be a matrix, the wiring and coding would both be simpler with 4 bits used as inputs instead of 2 out and 2 in to drive and read a matrix.
code :


Share : facebook icon twitter icon
creating own keypad on android

creating own keypad on android


By : juxsus
Date : March 29 2020, 07:55 AM
I wish this help you Try bellow link here you will have some information about custom keypad on android.
http://tutorials-android.blogspot.in/2011/06/create-your-own-custom-keyboard-for.html
Creating an Alphanumeric keypad using vb.net

Creating an Alphanumeric keypad using vb.net


By : Leo
Date : March 29 2020, 07:55 AM
I wish this helpful for you Hey Guys :) firstly thanks to all that viewed my question and especially to Idle_Mind for the suggestion. I was able to find a solution and get what I need, Its still very "Buggy" and there are alot of things to sort out but the core concept was achieved. The code to the solution is as follows (Please excuse the comments in code as I do cleanup after getting everything working as it should):
code :
Public Class Form1
Dim WithEvents intTimer As New System.Timers.Timer
Dim hitCounter As Integer = 1
Dim value As String = ""

Public Sub startTimer()
    intTimer.Interval = 1500
    intTimer.Start()
End Sub

Public Sub setText_1()
    If Me.txtInput.InvokeRequired Then
        Me.txtInput.Invoke(New MethodInvoker(AddressOf setText_1))
    Else
        Dim cursorPos As Integer = txtInput.SelectionStart
        txtInput.Select(cursorPos + 1, 0)
        Me.ActiveControl = txtInput
        hitCounter = 1
        value = ""
    End If
End Sub

Public Sub timer_Elapsed(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles intTimer.Elapsed
    setText_1()
    intTimer.Stop()
End Sub

Public Sub BtnLoseFocus(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn1.Leave, btn2.Leave, btn3.Leave, btn4.Leave, btn5.Leave, btn6.Leave, btn7.Leave, btn8.Leave, btn9.Leave
    txtInput.SelectedText += value
    hitCounter = 1
End Sub

Private Sub btn1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn1.Click
    If btn1.Focused Then
        startTimer()
        If hitCounter <= 3 Then
            Select Case hitCounter
                Case 1
                    'txtInput.Text += "A"
                    value = "A"
                Case 2
                    'txtInput.Text = "B"
                    value = "B"
                Case 3
                    'txtInput.Text += "C"
                    value = "C"
                Case Else
                    'txtInput.SelectedText += "1"
                    value = "1"
            End Select
            hitCounter += 1
        End If
    Else
        hitCounter = 1
    End If
End Sub

Private Sub btn2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn2.Click
    'hitCounter = 1
    If btn2.Focused Then
        startTimer()
        If hitCounter <= 3 Then
            Select Case hitCounter
                Case 1
                    'txtInput.Text += "A"
                    value = "D"
                Case 2
                    'txtInput.Text = "B"
                    value = "E"
                Case 3
                    'txtInput.Text += "C"
                    value = "F"
                Case Else
                    'txtInput.SelectedText += "1"
                    value = "2"
            End Select
            hitCounter += 1
        End If
    End If
End Sub

Private Sub btn3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn3.Click
    'hitCounter = 1
    startTimer()
    If hitCounter <= 3 Then
        Select Case hitCounter
            Case 1
                'txtInput.Text += "A"
                value = "G"
            Case 2
                'txtInput.Text = "B"
                value = "H"
            Case 3
                'txtInput.Text += "C"
                value = "I"
            Case Else
                'txtInput.SelectedText += "1"
                value = "3"
        End Select
        hitCounter += 1
    End If
End Sub

Private Sub btn4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn4.Click
    'hitCounter = 1
    startTimer()
    If hitCounter <= 3 Then
        Select Case hitCounter
            Case 1
                'txtInput.Text += "A"
                value = "J"
            Case 2
                'txtInput.Text = "B"
                value = "K"
            Case 3
                'txtInput.Text += "C"
                value = "L"
            Case Else
                'txtInput.SelectedText += "1"
                value = "4"
        End Select
        hitCounter += 1
    End If
End Sub

Private Sub btn5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn5.Click
    'hitCounter = 1
    startTimer()
    If hitCounter <= 3 Then
        Select Case hitCounter
            Case 1
                'txtInput.Text += "A"
                value = "M"
            Case 2
                'txtInput.Text = "B"
                value = "N"
            Case 3
                'txtInput.Text += "C"
                value = "O"
            Case Else
                'txtInput.SelectedText += "1"
                value = "5"
        End Select
        hitCounter += 1
    End If
End Sub

Private Sub btn6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn6.Click
    'hitCounter = 1
    startTimer()
    If hitCounter <= 3 Then
        Select Case hitCounter
            Case 1
                'txtInput.Text += "A"
                value = "P"
            Case 2
                'txtInput.Text = "B"
                value = "Q"
            Case 3
                'txtInput.Text += "C"
                value = "R"
            Case Else
                'txtInput.SelectedText += "1"
                value = "6"
        End Select
        hitCounter += 1
    End If
End Sub

Private Sub btn7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn7.Click
    'hitCounter = 1
    startTimer()
    If hitCounter <= 3 Then
        Select Case hitCounter
            Case 1
                'txtInput.Text += "A"
                value = "S"
            Case 2
                'txtInput.Text = "B"
                value = "T"
            Case 3
                'txtInput.Text += "C"
                value = "U"
            Case Else
                'txtInput.SelectedText += "1"
                value = "7"
        End Select
        hitCounter += 1
    End If
End Sub

Private Sub btn8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn8.Click
    'hitCounter = 1
    startTimer()
    If hitCounter <= 3 Then
        Select Case hitCounter
            Case 1
                'txtInput.Text += "A"
                value = "V"
            Case 2
                'txtInput.Text = "B"
                value = "W"
            Case 3
                'txtInput.Text += "C"
                value = "X"
            Case Else
                'txtInput.SelectedText += "1"
                value = "8"
        End Select
        hitCounter += 1
    End If
End Sub

Private Sub btn9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn9.Click
    'hitCounter = 1
    startTimer()
    If hitCounter <= 2 Then
        Select Case hitCounter
            Case 1
                'txtInput.Text += "A"
                value = "Y"
            Case 2
                'txtInput.Text = "B"
                value = "Z"
            Case Else
                'txtInput.SelectedText += "1"
                value = "9"
        End Select
        hitCounter += 1
    End If
End Sub

Private Sub btnBackSpace_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBackSpace.Click
    Dim cursorPos As Integer = txtInput.SelectionStart
    If txtInput.Text.Length > 0 Then
        Me.ActiveControl = txtInput
        txtInput.Text = txtInput.Text.Remove(cursorPos - 1, 1)
        txtInput.Select(cursorPos - 1, 0)
    Else
        'Do nothing
        Me.ActiveControl = txtInput
    End If
End Sub

Private Sub btn0_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn0.Click
    'spacebar
    Dim cursorPos As Integer = txtInput.SelectionStart
    Me.ActiveControl = txtInput
    txtInput.SelectedText += " "
    txtInput.Select(cursorPos + 1, 0)
End Sub
USB keypad - Not getting same scan code in android

USB keypad - Not getting same scan code in android


By : tbaskette
Date : March 29 2020, 07:55 AM
Hope that helps
Yes, afaik scan codes are specific to firmware residing in hardware. i.e for keypad/keyboard devices scan code will be provided by hardware and they will be unique to distinguish keys.
Keypad scan for microcontroller

Keypad scan for microcontroller


By : 毛鈺祺
Date : March 29 2020, 07:55 AM
Does that help Store the last pressed key in a variable that you "display" (or do whatever you want with) until the next key is pressed, when you change the variable to the new key value.
PIC Microcontrollers: Scan inputs on a 4x4 Keypad, using only Port C RC0-RC3 in C

PIC Microcontrollers: Scan inputs on a 4x4 Keypad, using only Port C RC0-RC3 in C


By : ineedhelp
Date : March 29 2020, 07:55 AM
I hope this helps you . I'm new to PIC Microcontrollers & C programming and I've been set the task of creating my own Keypad scanning method that works exclusively on Port C (16F877A Microcontroller). Specifically, the program that uses this method only uses digits 1, 2, 4 and 5- so to be efficient, the scanner method is to only use RC0, RC1, RC2 and RC3 as the designated input/ outputs (I'm not allowed to use RC4-RC7). This essentially turns the 4x4 keypad into a 2x2 keypad. , One possible approach:
Hardware:
Related Posts Related Posts :
  • Program works but outputs trailing garbage values
  • Letting 2 pointer pointing to same address
  • Different ways to print the two-dimensional array's contents
  • C Programming : Confusion between operator precedence
  • C code inside a loop not being executed
  • C - Weird symbols
  • C - Get pointer adress to string
  • how to start a function using a Struct?
  • Trying to tweak sscanf() to ignore \n and \t
  • How to find the inverse of a Rectangular Matrix in C using GSL
  • sizeof() showing different output
  • How to select/read/copy values after specific character in a string
  • Jump from bootloader generates exception
  • Array dropping values, picks up garbage
  • Swig: Syntax error in input(3)
  • multiple definition and making sure function is correctly written
  • MD4 openssl core dumped
  • Undefined-Behavior at its best, is it -boundary break? -bad pointer arithmetic? Or just -ignore of aliasing?
  • Why am i getting problem3.c:20:23: error: expected expression before ‘int’?
  • Right Justified Zero filled String in C
  • C Function with parameter without type indicator still works?
  • How to transmit data from an interrupt handler to an user application?
  • Why do I get the error "bash: ./a.out: Permission denied" when I execute a C program in Linux mint 15
  • syntax of sigchld and its declaration
  • error using g_idle_add() in C++, same thing works in C
  • why if else or nested if else are called single statement in C
  • How do I interpret this printf in C
  • load the functions of a shell script without executing it
  • Is FilterSendNetBufferLists handler a must for an NDIS filter to use NdisFSendNetBufferLists?
  • How to write to flash memory using inline assembly?
  • More Return Statements vs. More Indentation
  • How to show an image on a PictureBox from resource?
  • Having malloced some memory,I could't calculator the proper size of the memories I malloced.I don't know why
  • What is the main difference between integer pointer and character pointer?
  • Why are some functions declared extern and header file not included in source in Git source code?
  • what is the use of fflush(stdin) in c programming
  • Is it safe to return file File descriptor locally allocated from another function In C
  • Changing undefined values of an array
  • What does an empty parameter list mean?
  • using strtol on a string literal causing segmentation fault
  • Same structure objects memory overlap?
  • C-Linux-Any way to pass command "history" to Linux shell?
  • Using #define in defining string size C
  • How to use thread pool and message queues in Multithreaded Matrix Multiplication?
  • Can't find how to select path to run a C program
  • Automatic variable in C not initialized but given fixed value within loop
  • main() function defined without return type gives warning
  • Output of following code with integer, float, char variable
  • why buffer memory allocation error in opencl
  • Why am I getting this error during run-time?
  • Strange behaviour of the pow function
  • task in increment , decrement , printf() , why these are evaluated in this manner in C
  • 28 extra bytes in bss
  • Waiting for multiple events without polling
  • Why are my variables reporting as "undeclared identifier" when compiling?
  • Correct AddNode function but somehing happens when I printf
  • When I traverse in the splay tree, then now which one is root?
  • Data type conversion in Postfix evaluation
  • No output in terminal (Head First C)
  • Data writes over after realloc
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org