Arduino Bus Destination Sign

Hi, I just bought an Arduino uno and matrix display (64x16) and I wanted to build one of those sign on top of busses that show the destination. The idea is to have a keypad that if I insert a code it writes something on the matrix… like if I insert code 234 it will display “HELLO”. Is it possible? i have a 3x4 matrix keypad and I also wanted to use a buzzer to bip every time I press a key.
Thanks for helping.

I attach the example code of my matrix. I already know how to convert the text to data, I just don’t know how to write the code. I know the basics of arduino’s code.

Here’s the matrix: https://bit.ly/2v0AT9l (Ebay)

The matrix have board that connects to arduino’s pins (2,3,4,5,6,7,8,9,10,11,12,13,ground), if you look the photos on ebay you can see the little board.

#define COL_PIXEL     64
#define ROW_PIXEL     16

int latchPin=8; //LT
int clockPin=12;//SK
int dataPin=11; //R1

int en_74138 = 2;
int la_74138 = 3;
int lb_74138 = 4;
int lc_74138 = 5;
int ld_74138 = 6;
 
unsigned int ROW_xPixel;
unsigned int ROW_num;
unsigned char Col_num_1;
unsigned char Col_num_2;
unsigned char Col_num_3;
unsigned char Col_num_4;
unsigned char Col_num_5;
unsigned char Col_num_6;
unsigned char Col_num_7;
unsigned char Col_num_8;


//Data code: Horizontal modulus ,Bytes reverse order

unsigned char  Bmp1[]=
{
/*------------------------------------------------------------------------------
;  Width X height (pixels): 64X16
;secondo
------------------------------------------------------------------------------*/
0xf, 0xc0, 0xff, 0xcf, 0xff, 0xcf, 0xff, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf, 0x30, 0xff, 0xcf, 0xff, 0xcf, 0xff, 0xf3, 0xf3, 0x33, 0xcc, 0xcf, 0xcf, 0xcc, 0xfc, 0xfc, 0xf, 0x3c, 0x0, 0xcf, 0x3, 0xcf, 0xff, 0x33, 0x33, 0xf3, 0xc, 0xc3, 0xc0, 0xcc, 0xc, 0xcc, 0xf, 0xf, 0x0, 0xcf, 0x3, 0xcf, 0xc3, 0xf3, 0x33, 0x33, 0xf, 0xc3, 0xcf, 0xcc, 0xc, 0xcc, 0xcf, 0x3, 0x0, 0xcf, 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i=0;i<=7;i++)
   {
      PORTB &=~(1<<(clockPin-8));//equate digitalWrite(clockPin,LOW);
       
     if(dataOut & (0x01<<i))  PORTB |=1<<(dataPin-8); //equate digitalWrite(dataPin,HIGH);
     else  PORTB &=~(1<<(dataPin-8));//equate digitalWrite(dataPin,LOW);
     
     PORTB |=1<<(clockPin-8);//equate digitalWrite(clockPin,HIGH);
     
   }
}

//Combine 2 bits/pixel to 1 bits/pixel 
unsigned char Combine_2BitsTo1Bit(unsigned char num,unsigned char *BMP)
{
  
  unsigned char Col_num_tem_1;
  unsigned char Col_num_tem_2;
  unsigned int Col_num_tem = 0;
  unsigned char i=0;
  unsigned char Col_num_1bit = 0x00;
  
  Col_num_tem_1 = *(BMP+num);
  Col_num_tem_2 = *(BMP+num+1);
  
  Col_num_tem = Col_num_tem_1;
  Col_num_tem |= (Col_num_tem_2 << 8);
  
 for(i=0;i<8;i++)
  {   
    if(Col_num_tem&(0x0003<<i*2)) Col_num_1bit |= (0x01<<i);
  }
  return ~Col_num_1bit;
}

//display one picture 
void display_martix(unsigned char *BMP)
{
  //Display count
  unsigned int dis_cnt=256;
  unsigned int i;
  
   for(i=0;i<dis_cnt*16;i++)
   {
     
     digitalWrite(en_74138, HIGH);//Turn off display
  
     //Col scanning
    shiftOut(Col_num_1);
    shiftOut(Col_num_2);
    shiftOut(Col_num_3);
    shiftOut(Col_num_4);
    shiftOut(Col_num_5);
    shiftOut(Col_num_6);
    shiftOut(Col_num_7);
    shiftOut(Col_num_8);
  
    digitalWrite(latchPin, LOW);
    digitalWrite(latchPin, HIGH);
  
    //Row scanning
    // AVR Port Operation 
    PORTD = ((ROW_xPixel << 3 ) & 0X78) | (PORTD & 0X87);//Write PIN 3 4 5 6 la_74138 lb_74138 lc_74138 ld_74138
     
    digitalWrite(en_74138, LOW);//Turn on display
  

     
    if(ROW_xPixel==15) ROW_xPixel=0; else ROW_xPixel++;
  
   /*
   // Single color,1 bits/pixel
   Col_num_1=~BMP[(COL_PIXEL/8)*ROW_xPixel];
   Col_num_2=~BMP[(COL_PIXEL/8)*ROW_xPixel+1];
   Col_num_3=~BMP[(COL_PIXEL/8)*ROW_xPixel+2];
   Col_num_4=~BMP[(COL_PIXEL/8)*ROW_xPixel+3];
   Col_num_5=~BMP[(COL_PIXEL/8)*ROW_xPixel+4];
   Col_num_6=~BMP[(COL_PIXEL/8)*ROW_xPixel+5];
   Col_num_7=~BMP[(COL_PIXEL/8)*ROW_xPixel+6];
   Col_num_8=~BMP[(COL_PIXEL/8)*ROW_xPixel+7];
 */
   
   //Single color,2 bits/pixel 
   Col_num_1 = Combine_2BitsTo1Bit((COL_PIXEL/8)*ROW_xPixel*2,BMP);
   Col_num_2 = Combine_2BitsTo1Bit((COL_PIXEL/8)*ROW_xPixel*2+2,BMP);
   Col_num_3 = Combine_2BitsTo1Bit((COL_PIXEL/8)*ROW_xPixel*2+4,BMP);
   Col_num_4 = Combine_2BitsTo1Bit((COL_PIXEL/8)*ROW_xPixel*2+6,BMP);
   Col_num_5 = Combine_2BitsTo1Bit((COL_PIXEL/8)*ROW_xPixel*2+8,BMP);
   Col_num_6 = Combine_2BitsTo1Bit((COL_PIXEL/8)*ROW_xPixel*2+10,BMP);
   Col_num_7 = Combine_2BitsTo1Bit((COL_PIXEL/8)*ROW_xPixel*2+12,BMP);
   Col_num_8 = Combine_2BitsTo1Bit((COL_PIXEL/8)*ROW_xPixel*2+14,BMP);
  
  // delayMicroseconds(1000); 
   
  }
  
}

void setup()
{
  pinMode(latchPin,OUTPUT);
  pinMode(clockPin,OUTPUT);
  pinMode(dataPin,OUTPUT);
  
  pinMode(en_74138,OUTPUT);
  pinMode(la_74138,OUTPUT);
  pinMode(lb_74138,OUTPUT);
  pinMode(lc_74138,OUTPUT);
  pinMode(ld_74138,OUTPUT);
  
  
  digitalWrite(en_74138, LOW);
  
  // AVR Port Settings
  DDRD |= 0x78; //Set PIN 3 4 5 6 output  
  
  
}


void loop()
{

  
 display_martix(Bmp1);

}

sos.ino (5.58 KB)

Right, first things first.

It is singularly inconvenient for many of us to examine code attachments.

Go and read the instructions, then go back and modify your post (use the "More --> Modify" option to the bottom right of the post) to insert the code in the post so we can examine it conveniently and accurately. This is perfect for any code under about 8k, as yours is.

If you do not mark it up as code, it could well be garbled and is certainly anything but easy to read.

Note: Also mark up any data in the same way. This includes error output that you get from the IDE.

And - before you post code, use "Auto Format" in the Tools menu to properly present the code. Then Ctrl-A to mark it all and the "Edit --> Save for Forum" option will add the "code" tags for you to post that code here.

Try and avoid unnecessary white space (blank lines). You should only use these to separate functional blocks of code.

Secondly, I have no idea what "an Arduino with a matrix display (64x16)" is - I haven't seen one of those! :astonished:

If you have bought an Arduino and you have also bought a matrix display then if you want assistance, you had better mention which Arduino this is and give a Web link to the actual matrix display because whether you realise it or not, there are a lot of different such displays.

After that you will need to show a diagram of how you have connected everything.