hwthinker icon

Helloworld Max7219 4 in1 Nodemcu esp8266

hwthinker | PRO | 01/24/19 08:27:16 PM UTC | 0 ⭐ | 481 👁️ | Never ⏰ | []
C++ |

1 KB

|

None

|

0 👍

/

0 👎

// Program to demonstrate the MD_Parola library
// MD_MAX72XX library can be found at https://github.com/MajicDesigns/MD_MAX72XX
// hello world max7219 FC16 model hardware in esp8266 edited by hwthinker
 
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>
 
// Define the number of devices we have in the chain and the hardware interface
// NOTE: These pin numbers will probably not work with your hardware and may
// need to be adapted
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 4
 
#define CLK_PIN   D5  // or SCK NODEMCU
#define DATA_PIN  D7 // or MOSI NODEMCU
#define CS_PIN    D8 // or SS NODEMCU
//VCC   3V3 pin NODEMCU
 
// Hardware SPI connection
MD_Parola P = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
// Arbitrary output pins
// MD_Parola P = MD_Parola(HARDWARE_TYPE, DATA_PIN, CLK_PIN, CS_PIN, MAX_DEVICES);
 
void setup(void)
{
  P.begin();
  P.displayText("Hello", PA_CENTER, 0, 0, PA_PRINT, PA_NO_EFFECT);
}
 
void loop(void)
{
  P.displayAnimate();
}

Comments