element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum wirless display using Arduino and NRF24L01
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 32 replies
  • Answers 2 answers
  • Subscribers 394 subscribers
  • Views 3136 views
  • Users 0 members are here
  • help
  • nrf24l01+
  • led
  • arduino
Related

wirless display using Arduino and NRF24L01

billpenner
billpenner over 11 years ago

I am bogged down in this project

I'm using Arduino UNO.
I Have the keyboard data decoded and printing to the serial port (computer) fine.
I  want to send this data to a 16X2  LCD as soon as it is entered on the keypad.
  The LCD is working fine with serial input from computer to the Arduino but I cannot get the data to display on the
  LCD as soon as  a key is depressed. I have to send “enter”, then all three numbers are displayed.
I must have all three numbers sent to the transmitter as a group but the LCD should display them instantly as they are entered.
When the three numbers have been entered , the "*" key will send the string of numbers to a  NRF24L01.
Another  NRF24L01 and Arduino UNO will decode the data and display the numbers on a large 3 digit, 7 segment display.
The 7 segment display/decoder is working fine.
I can't seem to get the keyboard data into a form suitable for sending to either the 16X2  LCD or the  NRF24L01.
I can't even seem to get it into a string. I guess this is the form I need?
I think the  NRF24L01 will need a string of 3 digit numbers as a string? Right?
This is the code I have so far. Any help in getting me headed in the right direction would be greatly appreciated.
I gone over and over all the examples and tutorials on strings I can find but I can't seem to absorb it enough to make it work.
// key board to remote display.
#include <Keypad.h>
#include <LiquidCrystal.h>
int i;
String  A;                // Setup string to contain the data to transmit.
String  B;
String  C;
String  D;
                                          // set up the keypad decode
const byte ROWS = 4;       // Four rows
const byte COLS = 3;         // Three columns
                                          // Define the Keymap
char keys[ROWS][COLS] = {
  {'1','2','3'},
  {'4','5','6'},
  {'7','8','9'},
  {'*','0','#'}
};
byte rowPins[ROWS] = { 5, 4, 3, 2 }; // keypad rows to Arduino pins
byte colPins[COLS] = { 6, 7, 8 }; //keypad columns to Arduino pins
                                                    // Create the Keypad
Keypad kpd = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
#define NRF2401                      // output pin to xmitter
void setup()
{
  Serial.begin(9600);
  }
void loop()
{
char key = kpd.getKey();
  delay(10);
  if(key)  // Check for a valid key.
     {
     switch (key)                            // check for transmit or clear keys
    {
      case '*':                                     //send data to transmitter
        Serial.print(key);                      // send data to xmitter
        Serial.println("  pressed");       //testing
      break;
    
                // digitalWrite(transmit); // for testing
                 // break;                          // for testing
      case '#':                                     // clear and reset data
       A,B,C="";                                   // clear strings
        Serial.print(key);    
        Serial.println(" Cleared");         // testing
       // Serial.println(C4);  // for testing
       break;                    
   
      default:    //accum max 3 char
        for(int i=0 ; i<4 ; i++){
         if (i==1)
           A = A + char(key);
           Serial.print (A);            // for testing
           Serial.print (key);        // for testing
         if(i==2)
           B = A +(key);               // for testing
           Serial.print(B);            // for testing
         if(i==3)  
           C = B +(key);
          Serial.println(C);          // for testing
           Serial.print(i);             // for testing
           Serial.print (A);           // for testing
        break;
         // Serial.println(C);         // for testing
       }
     }
     /*    Serial.print (A);
           Serial.print(char(B));                        // For testing
           Serial.print(char(C));
           Serial.print (char(A+B+C+D));
     */
          if(i==4)                                                    //Too many digits! Only three allowed
           Serial.print("   ERROR");
         // Serial.println(i) ;
    }
  }  
  • Sign in to reply
  • Cancel

Top Replies

  • bobcroft
    bobcroft over 10 years ago in reply to Former Member +1
    Hi Averil, Peter has posted some information for you that will help you. However, if you need anything else please send me your email address and I'll forward what I have. I used an Arduino and a LCD display…
  • billpenner
    0 billpenner over 11 years ago in reply to Robert Peter Oakes

    I am so embarrassed. I obviously deleted while I was cleaning it up. What a foolish mistake. I vow to pay better attention in the future. Thanks for being so nice.

    Bill

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Robert Peter Oakes
    0 Robert Peter Oakes over 11 years ago in reply to billpenner

    No worries, happens to us all from time to time

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • billpenner
    0 billpenner over 11 years ago in reply to Robert Peter Oakes

    I am coming along nicely in the time that I have to give to the project. Learning is hard at my age.

    I am thinking about using the 74C922 keyboard decoder. I will give me a Data Available pin and  includes de-bounce as well.

    This will save me 3 pins and allow me to forgo the Mega.

    My question is how hard is it to read and store BCD data.

    I cant seem to find any help for inputting BCD to the Arduino. Can you help?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • bobcroft
    0 bobcroft over 11 years ago in reply to billpenner

    Bill,

             I cannot help you with the 74C922 because, last time I looked, it was somewhat expensive here in the UK.  I used the PCF8574 I2C I/O expander with a 4 * 4 matrix keypad.  The PCF8574 is considerably cheaper than the 94C922  and to my mind much more flexible and versatile once you have mastered its control.  Being I2C it only uses two pins on the Arduino and it has 8 programmable addresses.

    The libraries I used are keypad_I2C.h and keypad.h.  These libraries provide the value of the key pressed to the Arduino and you can choose what value each key represents, for example you could choose to return the ASCII value of the key, say 8.  This value could be printed directly to an LCD or you could subtract ASCII 0 from it to get the numerical value.

    I really like my I2C key pad, it works well along with my I2C LCD display on the same two pins! but with different addresses.  I have had no issues with key bounce problems and I believe the library takes care of this anyway. There is no BCD manipulation.

    hope that helps

     

    Bob

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Robert Peter Oakes
    0 Robert Peter Oakes over 11 years ago in reply to bobcroft

    I concur, the I2C 8574 is an easy chip to control and scanning a matrix keyboard has been done several times with it so there should be a few examples available on the web for you

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • bobcroft
    0 bobcroft over 11 years ago

    Bill,

              I have a document that I produced that shows the connections from a 4 * 4 matrix keypad to the 8574 and the basic code to use it.  I do not lay claim to the originally of the code as it is what I pulled together from other peoples work on the web.  There are two versions of the 8574, the 'A' version has a different address range.  Therefore if you really wanted you could add 8 off 8574's and 8 off 8574A's to give a total of 16 * 8 128 extra I/O on 2 wires from the Arduino!

    There are variants of the keypads and there appears to be no standard for the pin outs.  However it is not difficult to determine what the connections are with a multimeter.  The code can then be easily changed to produce the output you want.

     

    I could probably convert the notes I have to a PDF if you wish and sent it via email.  I do not know how to add documents to my replies on this site. Actually I have never tried!

     

    Bob

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • Former Member
    0 Former Member over 10 years ago in reply to bobcroft

    Bob;

     

    Could you email me you notes on this project.

    Do you have a library for the 8574 and a working example.

     

    Thanks Averil

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Robert Peter Oakes
    0 Robert Peter Oakes over 10 years ago in reply to Former Member

    Try this, full description for using this chip with the keypad

     

    http://www.instructables.com/id/I2C-keypad/?ALLSTEPS

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • bobcroft
    0 bobcroft over 10 years ago in reply to Former Member

    Hi Averil,

                    Peter has posted some information for you that will help you.  However, if you need anything else please send me your email address  and I'll forward what I have.  I used an Arduino and a LCD display on my project.  There are also several modules that can be bought that cover both a matrix keypad and a LCD display functionality on a small PCB.  That said the 8574 chip is a very versatile device, fun to learn and be creative with.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • bozone44
    0 bozone44 over 10 years ago in reply to bobcroft

    Thanks for the info on the i2c keyboard.

    The example from instructables is for a PIC controller, Do you have a sketch for Arduino?

    If you have further info please send it to me.

     

    norm.heath@gmail.com

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
<>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube