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…
Parents
  • Robert Peter Oakes
    0 Robert Peter Oakes over 11 years ago

    I see no code what so ever here to write to the LCD, sure you have the library included but thats it

     

    you need to create an instance of the LCD library and send the data to it as you read from the keypad

     

    this might help get you started http://tronixstuff.com/2013/12/16/arduino-tutorials-chapter-42-numeric-keypads/

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

    I apologize for that omission but that section uses the example "LiquidCrystal Library - Serial Input" from Arduino almost verbatim. I think that will be easier after the data is created to send to the radio. if you disagree, I will send the sketch including that part if it will help.

    Thank you so very much for your help. I will study your link in the meantime.

    Bill

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

    I apologize for that omission but that section uses the example "LiquidCrystal Library - Serial Input" from Arduino almost verbatim. I think that will be easier after the data is created to send to the radio. if you disagree, I will send the sketch including that part if it will help.

    Thank you so very much for your help. I will study your link in the meantime.

    Bill

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
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