Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "SparkIntervalTimer/SparkIntervalTimer.h"
- #include "Adafruit_mfGFX/Adafruit_mfGFX.h" // Core graphics library
- #include "RGBmatrixPanel/RGBmatrixPanel.h" // Hardware-specific library
- #define CLK D6
- #define OE D7
- #define LAT A4
- #define A A0
- #define B A1
- #define C A2
- #define D A3
- #define MAXLINE 2048
- TCPServer server = TCPServer(17061);
- TCPClient client;
- String message = "";
- RGBmatrixPanel matrix(A, B, C, D, CLK, LAT, OE, false);
- void read_message();
- void setup() {
- // start listening for clients
- server.begin();
- Serial1.begin(115200);
- matrix.begin();
- }
- void loop() {
- if (client.connected())
- {
- read_message();
- for(int x = 0; x < message.length(); x++)
- {
- Serial1.print(message.charAt(x));
- }
- message = "";
- }
- else
- {
- // if no client is yet connected, check for a new connection
- //client.stop();
- client = server.available();
- }
- }
- void read_message()
- {
- while(client.connected())
- {
- if(client.available())
- {
- char c = client.read();
- message += c;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement