title: Arduino code for multiple buttons and LED matrix
body: <p>I'm trying to build a system using Arduino Uno, 8x8 LED matrix and 3 push buttons. The goal of the system is to display 3 different characters upon pushing the 3 buttons correspondingly. For instance, I've chosen the letters A,B,C. When the button corresponding to A is pressed, the letter A must be displayed and similar for B and C too. I'm kinda stuck in this code, where it seems logically correct for me but I have no idea why it isn't working. Thanks in advance.</p>
  
  <pre><code>#include "LedControlMS.h"
  #define NBR_MTX 1
  LedControl lc=LedControl(4,3,2, NBR_MTX);//
  const int buttonPinA = 8;
  const int buttonPinB = 9;
  const int buttonPinC = 10;
  char ip2;
  void setup()
  {
    Serial.begin(9600);
    for (int i=0; i&lt; NBR_MTX; i++)
    {
      lc.shutdown(i,false);
      lc.setIntensity(i,8);
      lc.clearDisplay(i);
      delay(100);
    }
  }
  void Fun1()
  {
                lc.writeString(0,"A");
                delay(500);
                lc.clearAll();
  }
  void Fun2{
            lc.writeString(0,"B");
                delay(500);
                lc.clearAll();
  }
  void Fun3()
  {
                lc.writeString(0,"C");
                delay(500);
                lc.clearAll();
  }
  void loop(){
  
  if( digitalRead(buttonPinA) == HIGH){
    ip2 = 1;}
  else if(digitalRead(buttonPinB) == HIGH){
    ip2 = 2;}
  else if(digitalRead(buttonPinC) == HIGH){
    ip2 = 3;
  }
  if(ip2 == '1'){
  for(int i=1;i&lt;=6;i++){
    Fun1();
    }
  }
  else if(ip2 == '2')
  {
   for(int i=1;i&lt;=6;i++){
   Fun2();}
  }
  else if(ip2 == '3'){
  for(int i=1;i&lt;=6;i++){
  Fun3();}
  }}
  </code></pre>