LedP10 : Arduino library for P10 LED Display Panels


An arduino library, written to drive popular HUB12 based single color P10 LED display panels. It uses TimerOne and SPI library of arduino.


 Library features:

      • Can drive up to 320×16 pixels (10 Panels connected in cascade)
      • Supports dual line display, i.e. one panel divided into two.
      • Supports dynamic screen refresh. You can program to display dynamic content on the panels.
      • Supports different scroll speeds.
      • Static and scrolling text mode. Can switch from one to another at run time.
      • Supports only text based content right now.
      • 256 step Brightness control.

downloadLedP10 Library


Installation :

  • Unzip the LedP10 archive inside any directory on your machine.
  • Read the readme Install file.
  • Copy LedP10 folder into /Arduino/libraries of your arduino installation.
  • Open arduino IDE. (You need to reopen it after installing the LedP10 library).
  • In Arduino IDE, goto File > Examples > LedP10
  • You will find a few example program to demonstrate the usage of our library.
  • Build your own project by modifying these examples in the way you want.

Suggested Wiring to run example codes

p10 Wiring LedP10 Arduino Library

p10 Wiring LedP10 Arduino Library


LedP10 Example Codes:

Our library provides following examples that you can use to design your own LED sign board display systems:

Example -1 : Static Display with dynamic content

/*
 LedP10 Example Program
 Reads the value from ADC Channel A0 and Display on P10
 */
#include "TimerOne.h"
#include "SPI.h"
#include "LedP10.h"
 
LedP10 myled;
void setup()
{
     myled.init(3,4,8,9,1);
     /*
      P10 Select Line A - Arduino Pin 3
      P10 Select Line B - Arduino Pin 4
      P10 Store Line    - Arduino Pin 8
      P10 OE Line       - Arduino Pin 9
      No. of Panels     - 1 (Can be up to 10)
     */
}
void loop()
{
      int sensorValue = analogRead(A0);
      // Display sensorValue statically in single line with font 0
      myled.showmsg_single_static(sensorValue,0);
      delay(500);
}

Example 2 – Static Display with dynamic content

/*
 * This example displays an integer counter value.
 * showmsg_single_static function takes two arguments
 * first argument can be an interger value or a pointer to character string or a string in double quotes.
 * second argument is to select font, for which rwo values i.e. 0 and 1 are supported.
 */

#include "TimerOne.h"
#include "SPI.h"
#include "ledP10.h"
 
int num1=0;
LedP10 myled;

void setup() 
{
    myled.init(3,4,8,9,1);
      /*
      P10 Select Line A - Arduino Pin 3
      P10 Select Line B - Arduino Pin 4
      P10 Store Line    - Arduino Pin 8
      P10 OE Line       - Arduino Pin 9
      No. of Panels     - 1 (Can be up to 10)
      */
}
void loop() 
{
    myled.showmsg_single_static(num1,0);
    num1+=1;
    delay(500);
}

Example 3 – Double line static display

/*To display two counters of height 8 pixels.
function showmsg_double_static takes three arguments, first two can be either pointer to string or integer independently. Third argument is to select font for which only one value is supported currently i.e. 0.*/

#include "TimerOne.h"
#include "SPI.h"
#include "ledP10.h"
int num1=0,num2=1;
LedP10 myled;

void setup() 
{
      myled.init(3,4,8,9,1);
      /*
      P10 Select Line A - Arduino Pin 3
      P10 Select Line B - Arduino Pin 4
      P10 Store Line    - Arduino Pin 8
      P10 OE Line       - Arduino Pin 9
      No. of Panels     - 1 (Can be up to 10)
      */
} 
void loop() 
{ 
      myled.showmsg_double_static(num1,num2,0); 
      num1+=1; 
      num2+=2; 
      delay(500); 
}

Example 4 – Single line and double line scrolling text

/*This example illustrates two user funcions of LedP10 library

First function-showmsg_single_scroll is for scroling of single message on P10 panel with 4 arguments which are message, no. of times of message scrolling, speed and font.

for message, pointer to a character string can be passed. For continuously running the message, INF can be passed in second argument, speed can be in range of 0-30, and font can be 0 or 1 as two type of fonts are currently supported for full screen messages. 


For second function-showmsg_double_scroll, there would be 7 arguments, 2 for messages, two for no. of times of message scrolling, two for speed, and last one for font. 

Specification being same as for single scrolling function, except only one font id provided for double scrolling and it's value should be 0.*/
 
#include "TimerOne.h"
#include  "SPI.h"
#include  "ledP10.h"

LedP10 myled;

void setup() 
{
   myled.init(3,4,8,9,5);
       /*
      P10 Select Line A - Arduino Pin 3
      P10 Select Line B - Arduino Pin 4
      P10 Store Line    - Arduino Pin 8
      P10 OE Line       - Arduino Pin 9
      No. of Panels     - 5 (Can be up to 10)
      */

 
   myled.showmsg_single_scroll("this is single led test",2,3,0);
   delay(6000);
   myled.showmsg_double_scroll("this is double led test1","this is double led test2",10,INF,3,1,0); 
}

void loop() 
{
 
}

Example 5 – Brightness control

/*This example is to illustrate the use of the functon <setbrightness(uint8_t brightness)>, this function takes one argument of type uint8_t, it's value can be from 0 to 255, 255 being highest brightness and 0 is lowest.

this function can be called anytime after or before calling any other function of LedP10 library. 

In this example brightness reduces when counter 'num1' reaches value of 50.
*/

#include "TimerOne.h"
#include "SPI.h"
#include "ledP10.h"
int num1=0;
LedP10 myled;

void setup() 
{
    myled.init(3,4,8,9 ,1);
}
void loop() 
{
   if(num1==50)
   {
      myled.setbrightness(50);
   }
   myled.showmsg_single_static(num1,0);
   num1+=1;
   delay(500);
}

Comment below to report any issues and bugs related to this Arduino library.


SPONSORED LINKS :

Outdoor P10 Single Color RED panel 32x16 High Quality P10 LED Panel with connectors [Buy in India]
ZH-UN LED Panel Display Controller LED Display controller card [Buy in India]
SMPS 5V Output 5V / 5A or 5V/10A SMPS [Buy in India]
Arduino_Uno_-_R3 Arduino UNO R3 [Buy in India]

  • Amanullah Kadermoideen

    Dear Sirs,

    “TimerOne.h”
    “SPI.h”

    Files are missing , hence not able compliing.Arduino: 1.8.3 (Windows 7), Board: “Arduino/Genuino Uno”

    C:\Users\amanulla\Desktop\LedP10\LedP10\examples\static_double_example\static_double_example.ino:7:22: fatal error: TimerOne.h: No such file or directory

    #include

    ^

    compilation terminated.

    exit status 1
    Error compiling for board Arduino/Genuino Uno.

    This report would have more information with
    “Show verbose output during compilation”
    option enabled in File -> Preferences.

    • Hey Amanullah,

      You have to install TimerOne library separately. Link to TimerOne download https://playground.arduino.cc/Code/Timer1

      • K J Mathew

        Hi Devesh: Arduino library for P10 LED Display Panels is it possible to drive two row p10 display (16*32 top row 16*32 bottom row ) if possible please share the code my mail…….waiting for your valued reply …
        Thanks & Regards,
        K J Mathew

        • Each row will require one arduino. Our library does not support 2 rows right now.

  • Amanullah Kadermoideen

    Thanks, Mr Samaiya,
    I think that I have overcome one issue by your advice, but I get the following err msg, pl help me out

    Arduino: 1.8.3 (Windows 7), Board: “Arduino/Genuino Uno”

    C:\Users\amanulla\Desktop\sketch_jun21b\sketch_jun21b.ino:3:20: fatal error: LedP10.h: No such file or directory

    #include “LedP10.h”

    ^

    compilation terminated.

    exit status 1
    Error compiling for board Arduino/Genuino Uno.

    This report would have more information with
    “Show verbose output during compilation”
    option enabled in File -> Preferences.

    • Please make sure that you have installed the library properly. Arduino is not able to locate the library. Go through the Installation instruction file in the downloaded archive.

  • Albán Prada

    Hi Devesh:

    I think your library is very good. I have doubts:
    * Why Led Display controller Card (the red PCB) is required?
    * Does Arduino UNO replaces the controller card?
    * I understand that 3 components are required: (1) Power Supply, (2) Arduino UNO and (3) the Led panel. Is that right?
    * Is the wiring between Arduino and Panel?

    Regards,

    Alban

    • Hi,
      Red LED controller card is not required. All you need is Arduino, Power Supply and Panel itself. Wiring is done from arduino to panel.

  • supri

    do you have tools for make custom font?

  • Albán Prada

    static_double_example:12: error: ‘LedP10′ does not name a type
    static_double_example.ino: In function ‘void setup()’:
    static_double_example:16: error: ‘myled’ was not declared in this scope
    static_double_example.ino: In function ‘void loop()’:
    static_double_example:21: error: ‘myled’ was not declared in this scope

    ?????????????

  • Raghbendra Kumar Patel

    Hi i want to connect P10 led modules in two rows i.e 1 feet height and 8 feet length. Can u tell me how to interface this with the arduino.

    • You can use two arduino for that, one arduino for 1 row of 8 panels and another arduino for another row of 8 panels.

  • A J

    I tried almost everything, but it kept saying “fatal error: ledP10.h: No such file or directory”.
    Problem persist even after include library option.
    Any clue about this?

    • Please make sure that the library is properly installed at correct location.

      • Raghbendra Patel

        Can you give the code and library file on how to control the p10 led module with usb keyboard using arduino with usb shield.

  • Cao Nam

    Hi, can you give me the FontCreator written by F. Maximilian Thiele. I followed the link http://www.apetech.de/fontCreator but the site died!
    Thank you so much.
    Please send to my email: caonam@gmail.com

  • jagjit chawla

    Great instructions, very clear and easy to follow.
    I downloaded the library and connected as suggested. The problem is that I am getting random dots on the DMD instead of the text message.
    Please note that I tried with another display driver board (the BX-5T) and the display is working properly so what could be the problem?
    Can you please help. I am using Arduino pro mini board and a generic P10 16×32 red display module.
    Thanks and regards

    • Please make sure that you have made all the connections properly and configured same pins in the code. If problem still persists please comment here and I will try my best to rectify it.

    • Also, on your Arduino board please verify the MOSI and SCK pins are same as shown in the connection diagram.

  • prajval

    this library is not working
    Arduino: 1.8.4 (Windows 7), Board: “Arduino/Genuino Uno”

    Invalid library found in C:\Program Files (x86)\Arduino\libraries\LedP: C:\Program Files (x86)\Arduino\libraries\LedP
    Invalid library found in C:\Program Files (x86)\Arduino\libraries\LedP: C:\Program Files (x86)\Arduino\libraries\LedP
    Invalid library found in C:\Program Files (x86)\Arduino\libraries\LedP: C:\Program Files (x86)\Arduino\libraries\LedP
    Invalid library found in C:\Program Files (x86)\Arduino\libraries\LedP: C:\Program Files (x86)\Arduino\libraries\LedP
    Invalid library found in C:\Program Files (x86)\Arduino\libraries\LedP: C:\Program Files (x86)\Arduino\libraries\LedP
    Invalid library found in C:\Program Files (x86)\Arduino\libraries\LedP: C:\Program Files (x86)\Arduino\libraries\LedP
    Invalid library found in C:\Program Files (x86)\Arduino\libraries\LedP: C:\Program Files (x86)\Arduino\libraries\LedP
    Specified folder/zip file does not contain a valid library
    Invalid library found in C:\Program Files (x86)\Arduino\libraries\LedP: C:\Program Files (x86)\Arduino\libraries\LedP
    Invalid library found in C:\Program Files (x86)\Arduino\libraries\LedP: C:\Program Files (x86)\Arduino\libraries\LedP

    This report would have more information with
    “Show verbose output during compilation”
    option enabled in File -> Preferences.

  • Raghbendra Patel

    Can you give the code and library file on how to control the p10 led module with usb keyboard using arduino with usb shield.

  • SANJAY GOUR

    First of all we would like to thanks for your good efforts.
    We have used P10 module interfacing library function for arduino that is working fine.
    I am much comfortable with assembly language of 8051 core family controller.
    I am very new to C and C++ pl help me for the following issues.
    I am having serially received data string in “inputString” — string variable name.
    Now i want to pass this string data to your function

    myled.showmsg_single_static(inputString ,0);

    How may i use this function my string is of 03 bytes of chracter data.

    Pl help….

  • Vani Durgai

    Is it possible to connect and drive two rows of P10 displays with only independent clk signals.
    i.e I want 1X3, 1X3 two row displays. All pins OE, A,B,SSCKL,Rand GND are tied together. CLK pin is from different port of uc

    Thanks
    V Durgai

  • thiago silva candido

    Hi , this library work without the LED Display controller card?

  • Praveen

    Can we configure the D11 on the Arduino that is connected to the DATA(12) Pin of the LED Board to another Pin on the Arduino?
    I mean, can we use D12 or any other Pin to connect to the DATA Pin?
    The Problem is that the Pins 10, 11 on the Arduino Uno are used by Ethernet Shield. We can modify the header files if necessary.
    Please update me.
    Thanks in advance.

    -Praveen.

    • Hi, that won’t be possible as that particular Pin belong to SPI interface which is being used in the library.

    • Tufan Kutlu

      hey praveen we have the same problem here, if you could solve your problem, can you please contact me on tufan.kutlu@hotmail.com

  • Gokhan

    hello , i have 4 p10 panel and four variable number. i want to numberone module x1 variable, numbertwo module x2 variable, numbertree module x3 variable and numberfour module x4 variable write. how is make?

  • Debdas Choudhury

    Thanking you for your so much efforts.
    My request is… If possible please describe the library function.. so that i understand and able to create new effect..

  • David

    Looks good. Can this be used to drive RGB matrix as well?

    • No. it is designed only for single color matrix. You can use Adafruit library for RGB matrix panels.

  • Jose Cano

    Hi, im using your library and wired up and tested succesfully.

    But when I use the example to set a different brightness the brightness doesn’t behave as expected.

    When I set the brightness to 50 (as in the example, is very low as is supossed to), but when I set it to 128 (half max brightness) it is very bright (almost the same than on 255). When I set it to 100 it starts blinking (like when a monitor has a low refresh rate). So i’m playing with values but it is very low brightness or too high or blinking at diferent rates. Do you know what can that behaviour be?

    • Sometime it is dependent on the panels too. For our panels on which we developed the library the brightness functionality worked correctly. I hope you can find the optimal setting by tweaking the numbers.

  • anand

    Hi this is Anand,
    first of all i would like to thanking you for your P10 library for arduino,
    by using this library i developed a scrolling display code with arduino nano and bluetooth
    in this project i am updating messages and speed no.of panels ,using Bluetooth(HC-05)communication
    and all these arguments are storing in internal EEPROM,it is working around 20 times after that it was not
    taking any arguments (speed no.of panels) from Bluetooth and also from UART. if i flashing this program in another
    arduino nano there also it is not working would you please solve this problem or is there any locking mechanism did you
    applied in this library for limited number of times working.

    • There is no such limitation intended in the library. How many panels are you using?

    • Amol Thube

      Hello Anand,can you send me yours code.I am also working on same and facing problems as like yours.Actually i have to print double scrolling lines on P10 display after receiving text from bluetooth for infinte time and also want to update displaying text when i send next text from bluetooth.My mail Id: thube.a55@gmail.com

  • Kiran Kumar M

    hi friend this is kiran
    i am unable to include P10 in library
    its giving the error that ” the specified folder/ zip file does not contain a valid library
    plz do some help in this case

  • Kiran Kumar M

    hi friend this is kiran
    i am unable to include P10 in library
    its giving the error that ” the specified folder/ zip file does not contain a valid library
    plz do some help in this case

    • Make sure that you are having the libarary files extracted in correct location inside Arduino directory.

  • Syed

    Hi Devesh,

    Does this work on the esp8266 as well? The DMD2 library has some support but I like your library instead and wanted to confirm before I start tinkering.

    Thanks.

    • No it wont run directly on esp8266. Any patch is welcome.

  • Hi Devesh,
    First of All thank you for such a wonderful library, Scrolling is very smooth and fonts are great but there is one problem though when i am using single_scroll function it seems that SerialEvent is stuck and no serial input is handeled how can i display Data from serial on Scrolling ?

    • You have to use serial interrupts. It’s not a library issue but rather an issue in handling serial data in your sketch.

  • I am using Serial interrupts and the strange behavior that i notices was that serial interrupts are not fired until All scrolling is done can you please check and guide me a way for doing this. I am stuck at this for almost 4 days.

  • carlos tejada

    Hello friend
    I am workijg with your library and is ok. Thanks a lot
    I have a question

    I have a value of 3 digits and I need to put right when the value es less that 100.

    When value is more that 100 no problem.

    For example

    if Value is 78 I want to put spacewahite78 and no 78spacewhite
    or if value is 9 I want to put spacewhitespacewhite9 and not 9spacewhitespacewhite

    I would appreciate your help

  • carlos tejada

    I solved it

    It is necesary to declare a char cadena21[5];
    and after using:
    cadena21[0]=value1 +48;
    cadena21[1]=value2+48;
    cadena21[2]=value3+48;
    myled.showmsg_single_static(cadena21,0);

    If it is necesrary a space only use cadena21[0]=32;….

  • BHUPENDRA

    I USE ARDUINO UNO CODING UPLOAD COMPLETLY BUT RESULT NOT DISPLAY ON P10 SO PLZ HELP

    • Devesh Samaiya

      Please check your connections.

  • Prem Kumar R

    C:\Users\PREMKU~1\AppData\Local\Temp\arduino_modified_sketch_944344\LedP10_scrolling_example.ino:10:20: fatal error: ledP10.h: No such file or directory

  • gourish mesta

    hi everyone

    my panel has pin a,b,c,d r1,r2,g1,g2 ,clk,sclk,oe,gnd
    and ur wiring daigram is only for a,b, clk,sclk,data and oe

    how will i use this library with 128*16 display??

    thank you

  • Vinesh

    The library function is not working for static display.the display is not bright and is flickering,but this problem is not observed while using scrolling function.i am using eight modules in cascade.please help me solve this.

  • Devesh Samaiya

    LEDP10 Arduino Library for Interfacing HUB12 based P10 panels with Arduino

  • SAM

    Any library for HUB75?

    • Kuba Stachu

      HUB75 is much more resource-demanding and driving more than 1 module with Arduino/ATmega makes it flicker heavily. Try BeagleBone and OctoScroller/LEDScape/FalconChristmas solutions — they need a little work to make them operate with some of the modules, as they don’t come with scanning settings.

  • Dnyaneshwar Lagad

    how can i display Data from serial on Scrolling ?… static display is done.It shows data from serial, But how i display data on srolling.
    please help, i try from 3 days…

  • Chekam Mzussouo Wambo

    hello/ please using Arduino mega it respects the same warring? I try with it but the result shows only all the led on

  • Alan Deivson

    Hi, I’m trying to use a DMD with an Arduino. I’m sure that all my connections are right. When trying to write anything on the screen some LEDs seems to be half lighted (see the pictures) how can i fix it?
    I already tried:
    Change connections
    Change DMDs
    Change cables
    Change Arduino
    I’ve tried use another library and the half lighted leds still appears… https://uploads.disquscdn.com/images/cb9785fa22b297eae680cab4fe7e831ef556e9002925e4e71c0a850a32401463.jpg https://uploads.disquscdn.com/images/72e5b1399ab1504b2897ab5f7c690a191b6c3b6a113ca9ac50cd39dd30d54d01.jpg

    • Kuba Stachu

      That is a clear indication of shorted circuit, usually somewhere on the module itself.

      • Alan Deivson

        reached the answer, it was the nOE pin. Thanks :)

  • Sain Abraham

    There is an error showing that Timerone.h file not in the directory.hat should i do

    • Devesh Samaiya

      Install timerone library for Arduino

  • wilson

    Please help me it comes up with the Ledp10.h missing in the directory

    • Avong P Ayuba

      i think you need to look at the location of your LedP10.h and LedP10.cpp files. in my case, when i downloaded the library, i had to shift these files one folder backward. i complies with no error.

  • Avong P Ayuba

    Great job guys.
    The library work very good, i compared LedP10, DMD and DMD2 and it seems LedP10 better smooth effect at scrolling speed 8-10.
    However, there are few recommendations i make. do you mind tohelp me out create support for STM32 based in arduino?
    i have tried but i getting blank screen.
    secondly, i also tried to modify some functions to create vertical scrolling.
    thirdly, in showmsg_single_static(long int msg_,int font_) function, there is need modify to
    showmsg_single_static(long int msg_,int x, int y, int font_) such that the user can decide to position the text at chosen position on the screen.

  • vinesh nair

    Can this display Arabic font?and how to scroll from left to right..? Please help..