Advertisement
microrobotics

Makerfabs ESP32-Trinity Controller

May 10th, 2023
1,643
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. To drive a HUB75 display panel using the Makerfabs ESP32-Trinity Controller, you'll first need to install the PxMatrix library. This library allows for the control of HUB75-type RGB LED matrices with the ESP32.
  3.  
  4. This code will write "Hello, world!" to the display. You can modify it to display whatever you need.
  5.  
  6. Please make sure to check the pin configuration, display size, and refresh rate to match with your own HUB75 display.
  7.  
  8. Remember that not all HUB75 panels are created equal, so some may require different setup configurations. It's always best to refer to the datasheet of your specific panel if things aren't working as expected.
  9.  
  10. This code is quite basic and there's a lot more you can do. For example, you could connect the ESP32 to the internet and display live data, or you could create animations. The PxMatrix library has a lot of functionality that you can use to create more advanced displays.
  11.  
  12. Here's an example sketch that you can modify to fit your needs:
  13. */
  14.  
  15.  
  16. #include <PxMatrix.h>
  17.  
  18. // Pins for the ESP32 are defined here
  19. #define P_LAT 22
  20. #define P_A 19
  21. #define P_B 23
  22. #define P_C 18
  23. #define P_D 5
  24. #define P_E 15
  25. #define P_OE 2
  26.  
  27. // Change this to the width and height of your specific display panel
  28. #define matrix_width 64
  29. #define matrix_height 32
  30.  
  31. PxMATRIX display(matrix_width, matrix_height, P_LAT, P_OE, P_A, P_B, P_C, P_D, P_E);
  32.  
  33. void setup() {
  34.   Serial.begin(9600);
  35.  
  36.   // Define your display layout here, e.g. 1/8 step
  37.   display.begin(8);
  38.  
  39.   // If your panel has a different refresh rate, set it here:
  40.   display.setFastUpdate(true);
  41.   display.setMuxPattern(BINARY);
  42.  
  43.   display.fillScreen(0);
  44.   display.setTextColor(myRED);
  45.   display.setCursor(2,0);
  46.   display.print("Hello, world!");
  47.   display.display();
  48. }
  49.  
  50. void loop() {
  51.   // put your main code here, to run repeatedly:
  52. }
  53.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement