Skip to content

Commit

Permalink
fixing wif dot matrix example to 8 8x8 modules
Browse files Browse the repository at this point in the history
  • Loading branch information
solariun committed Aug 24, 2020
1 parent 7afbc88 commit 16c6a68
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions examples/WiFiDotMatrixDisply/WiFiDotMatrixDisply.ino
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
#include <assert.h>
#include <string>

#include "LedMatrix.cpp"
//#include "LedMatrix.cpp"

#define MAX(x, y) (x > y ? x : y)
#define MIN(x, y) (x < y ? x : y)
Expand All @@ -72,7 +72,7 @@ int CLK = D5; // SS - NodeMCU - D5 (HSCLK)

// Functions

#define MAX_LED_MATRIX 4
#define MAX_LED_MATRIX 8
LedControl lc = LedControl (DIN, CLK, CS, MAX_LED_MATRIX);

void SetLocation (Stream& device, uint16_t nY, uint16_t nX)
Expand Down Expand Up @@ -390,14 +390,14 @@ const char* topicDisplay = "display";

#define MATRIX_DISPLAY_CHANGE 1

void LedDisplayBrokerHandler (const char* pszTopic, size_t nSize, size_t nAttribute, uint64_t nValue )
void LedDisplayBrokerHandler (void* pContext, const char* pszTopic, size_t nSize, CpxMsgPayload payload)
{
if (strncmp (pszTopic, topicDisplay, sizeof (topicDisplay)-1) == 0)
{
switch (nAttribute)
switch (payload.nAttribute)
{
case MATRIX_DISPLAY_CHANGE:
strDisplay = (const char*) nValue;
strDisplay = (const char*) payload.nValue;
matrixTextScroller.Reset();
break;

Expand All @@ -407,14 +407,17 @@ void LedDisplayBrokerHandler (const char* pszTopic, size_t nSize, size_t nAttrib
}
}


char chContext = 'A';

/// LedDisplayShow - Will update information o Display
/// @param pValue Information injected from CorePartition on startup
void LedDisplayShow (void* pValue)
{
unsigned long start = millis ();
size_t nValue = 0;

CorePartition_EnableBroker (1, LedDisplayBrokerHandler);
CorePartition_EnableBroker ((void*) &chContext, 1, LedDisplayBrokerHandler);

CorePartition_SubscribeTopic (topicDisplay, sizeof (topicDisplay)-1);

Expand Down

0 comments on commit 16c6a68

Please sign in to comment.