I'm trying communication between two arduino uno r3.
my panel display total p10 module is 25 used.
i trying 1st arduino uno - connected 13 p10 module.
2 nd arduino uno - connected 13 p10 module.
one hardware serial port from pc and two arduino uno board connected.
in programming ..
my question is how can i declare different board(slave no.) number ie. one arduino send string when
(take slave no. 1)and displayed on 13 dmd p10 module.
2nd arduino send string when (take slave no.2) and displayed on other 13 dmd p10 module .
my code is...
/*--------------------------------------------------------------------------------------
Serial Read and Display.
This project is designed to Read inputs from Serial and Display the input on a
Freetronic 32x16 Dot Matrix Display.
To wipe your existing String simply input a Tilda (~) into your Serial Command.
Note, for debugging purposes, Serial.print has been used in both the Stop Display
and Write Display loops. These can be removed.
--------------------------------------------------------------------------------------*/
/--------------------------------------------------------------------------------------
Includes
--------------------------------------------------------------------------------------/
#include <DMD.h>
#include <SPI.h> //SPI.h must be included as DMD is written by SPI (the IDE complains otherwise)
#include <TimerOne.h>
#include "SystemFont5x7.h"
#include "Arial_black_16.h"
#define DISPLAYS_ACROSS 13
#define DISPLAYS_DOWN 1
DMD dmd(DISPLAYS_ACROSS, DISPLAYS_DOWN);
int board;
char serIn[200]; // Allocate some space for the string
void ScanDMD()
{
dmd.scanDisplayBySPI();
}
void setup()
{
Timer1.initialize( 4000 );
Timer1.attachInterrupt( ScanDMD );
dmd.clearScreen( true );
Serial.begin(9600);
}
void loop()
{
if(Serial.available()) {
int chars_in = 0;
//board=Serial.parseInt();
//if (board==1)
// void serialFlush(){
while (Serial.available()>0 && chars_in<199){
serIn[chars_in] = Serial.read();
Serial.write( byte(serIn[chars_in]));
chars_in++;
}
serIn[chars_in+1] = '\0';
}
//dmd.clearScreen( true );
//dmd.selectFont(Arial_Black_16);
dmd.selectFont(SystemFont5x7);
dmd.drawString(0, 0, serIn, 200, GRAPHICS_NORMAL );
dmd.drawString(0, 8, serIn+70, 200, GRAPHICS_NORMAL );
delay(1000);
}
please,reply for solve this problem.