Hello everyone,
i have a project that i am nearly finished but need some help with a couple of issues (also wanted to share my project if anyone finds it interesting)
essentially, i have 13 displays that are controlled over I2C. I have 2 arduino Uno as i can have a maximum of 8 displays on 1 bus (i was given another arduino by the employers, they said this would be better rather than bit banging my way to get 13 on one bus. I'm doing this project for in my internship)
So 2 buses: 7 displays and 6 displays, data is coming from an array called data[] in each programme.
I will be given a text file with my real data inside soon. I need to find a way to get this data into the arrays in my code. I have had a look online but could do with someone explaining this to me so i can make sense of it all.
I need to find a way to have a Master Slave setup with my 2 arduino's, i was thinking of just having a digital pinout going from the master to the slave and having the slave waiting for a rising edge and then iterating its 'loop' once using a while or if statement. What do you think about that?
#include <Wire.h>
#include "Adafruit_LEDBackpack.h"
#include "Adafruit_GFX.h"
Adafruit_7segment segment[6];
int address[6]={112,113,114,115,116,117}; // having another file written for 7 displays
int data[10][6] =
{
{1,2,3,4,5,6},
{7,8,9,10,11,12},
{13,14,15,16,17,18},
{19,20,21,22,23,24},
{25,26,27,28,29,30},
{31,32,33,34,35,36}, //arbitrary numbers used here for now
{37,38,39,40,41,42},
{43,44,45,46,47,48},
{49,50,51,52,53,54},
{55,56,57,58,59,60}
};
void setup()
{
#ifndef __AVR_ATtiny85__
Serial.begin(9600);
#endif
for (int i=0;i<6;i++)
{
segment[i]=Adafruit_7segment();
segment[i].setBrightness(10);
segment[i].begin(address[i]);
}
}
void loop()
{
for (int k=0; k<10; k++){
for (int i=0; i<6; i++)
{
segment[i].print(data[k][i]);
segment[i].writeDisplay();
delay(10);
}
delay(2000); //this time delay is irrelevant, i did it for ease of viewing
}
}
thanks for any replies.