/**************************************************
u8g2_font_6x10_mr: A compact font that is 6 pixels wide and 10 pixels high.
u8g2_font_6x12_mr: Slightly taller than the 6x10, providing a bit more legibility.
u8g2_font_7x14_tf: A taller font that is 7 pixels wide and 14 pixels high, good for displays with more vertical space.
u8g2_font_5x8_tf: A smaller font that is 5 pixels wide and 8 pixels high, useful for fitting more text on a screen.

****************************************/
#include <Arduino.h>
#include <U8g2lib.h>

#ifdef U8X8_HAVE_HW_SPI
#include <SPI.h>
#endif
#ifdef U8X8_HAVE_HW_I2C
#include <Wire.h>
#endif

// Initialize the display
U8G2_MAX7219_64X8_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ U8X8_PIN_NONE, /* reset=*/ U8X8_PIN_NONE);

void setup(void) {
  // Begin the display
  u8g2.begin();
  // Set the display contrast
  u8g2.setContrast(160);
}

void loop(void) {
  // Set the font for the display uncomment witch you want to use
   u8g2.setFont(u8g2_font_victoriabold8_8r);
  //u8g2.setFont(u8g2_font_6x10_mr);
  //u8g2.setFont(u8g2_font_6x12_mr);
  //u8g2.setFont(u8g2_font_7x14_tf);
  //u8g2.setFont(u8g2_font_5x8_tf);
 


  
  // Calculate the width of the string
  int strWidth = u8g2.getStrWidth("I AM KAI29 FROM THAILAND HAVE A NICE DAY");
  
  // Loop to scroll the text from right to left
  for (int i = 64; i >= -strWidth; i--) {
    u8g2.clearBuffer(); // clear the internal memory
    u8g2.drawStr(i, 8, "I AM KAI29 FROM THAILAND  HAVE A NICE DAY"); // write something to the internal memory
   
   
   
    u8g2.sendBuffer(); // transfer internal memory to the display
    delay(200); // delay between each scroll step
  }
}
uno:A5.2
uno:A4.2
uno:AREF
uno:GND.1
uno:13
uno:12
uno:11
uno:10
uno:9
uno:8
uno:7
uno:6
uno:5
uno:4
uno:3
uno:2
uno:1
uno:0
uno:IOREF
uno:RESET
uno:3.3V
uno:5V
uno:GND.2
uno:GND.3
uno:VIN
uno:A0
uno:A1
uno:A2
uno:A3
uno:A4
uno:A5
matrix1:V+
matrix1:GND
matrix1:DIN
matrix1:CS
matrix1:CLK
matrix1:V+.2
matrix1:GND.2
matrix1:DOUT
matrix1:CS.2
matrix1:CLK.2
matrix2:V+
matrix2:GND
matrix2:DIN
matrix2:CS
matrix2:CLK
matrix2:V+.2
matrix2:GND.2
matrix2:DOUT
matrix2:CS.2
matrix2:CLK.2
matrix3:V+
matrix3:GND
matrix3:DIN
matrix3:CS
matrix3:CLK
matrix3:V+.2
matrix3:GND.2
matrix3:DOUT
matrix3:CS.2
matrix3:CLK.2