Hello. I am trying to modify the POV code to be able to store complete messages(messages[11][16]) and combine them. I want the be able to switch between the different combined messages(messagecombine[5][6]) with a push button, but I am getting this error:
In function 'void loop()':
error: invalid conversion from 'int' to 'int*'
Here is my code:
/*
????????????????????????????????????????????
persistence of vision typography with arduino
michael zoellner - march 2006
http://i.document.m05.de
||||||||||||||||||||||||||||||||||||
Modified By Tim Ballas - August 2007
||||||||||||||||||||||||||||||||||||
connect anodes (+) of 5 leds to digital ports of the arduino board
and put 20-50 ohm resistors from the cathode (-) to ground.
the letters are lookup tables consisting arrays width the dot status in y rows.
????????????????????????????????????????????
*/
int PushbuttonPin = 7;
int messageval = 0;
int reading; // the current reading from the input pin
int previous = LOW; // the previous reading from the input pin
// the follow variables are long's because the time, measured in miliseconds,
// will quickly become a bigger number than can be stored in an int.
long time = 0; // the last time the output pin was toggled
long debounce = 200; // the debounce time, increase if the output flickers
// defining the alphabet
int _[] = {0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0};
int A[] = {0,1,1,1,1, 1,0,1,0,0, 0,1,1,1,1};
int B[] = {1,1,1,1,1, 1,0,1,0,1, 0,1,0,1,0};
int C[] = {0,1,1,1,0, 1,0,0,0,1, 1,0,0,0,1};
int D[] = {1,1,1,1,1, 1,0,0,0,1, 0,1,1,1,0};
int E[] = {1,1,1,1,1, 1,0,1,0,1, 1,0,1,0,1};
int F[] = {1,1,1,1,1, 1,0,1,0,0, 1,0,1,0,0};
int G[] = {0,1,1,1,0, 1,0,1,0,1, 0,0,1,1,0};
int H[] = {1,1,1,1,1, 0,0,1,0,0, 1,1,1,1,1};
int I[] = {0,0,0,0,1, 1,0,1,1,1, 0,0,0,0,1};
int J[] = {1,0,0,0,0, 1,0,0,0,1, 1,1,1,1,1};
int K[] = {1,1,1,1,1, 0,0,1,0,0, 0,1,0,1,1};
int L[] = {1,1,1,1,1, 0,0,0,0,1, 0,0,0,0,1};
int M[] = {1,1,1,1,1, 0,1,1,0,0, 0,1,1,1,1};
int N[] = {1,1,1,1,1, 1,0,0,0,0, 0,1,1,1,1};
int O[] = {0,1,1,1,0, 1,0,0,0,1, 0,1,1,1,0};
int P[] = {1,1,1,1,1, 1,0,1,0,0, 0,1,0,0,0};
int Q[] = {0,1,1,1,1, 1,0,0,1,1, 0,1,1,1,1};
int R[] = {1,1,1,1,1, 1,0,1,0,0, 0,1,0,1,1};
int S[] = {0,1,0,0,1, 1,0,1,0,1, 1,0,0,1,0};
int T[] = {1,0,0,0,0, 1,1,1,1,1, 1,0,0,0,0};
int U[] = {1,1,1,1,1, 0,0,0,0,1, 1,1,1,1,1};
int V[] = {1,1,1,1,0, 0,0,0,0,1, 1,1,1,1,0};
int W[] = {1,1,1,1,0, 0,0,1,1,0, 1,1,1,1,0};
int X[] = {1,1,0,1,1, 0,0,1,0,0, 1,1,0,1,1};
int Y[] = {1,1,0,0,0, 0,0,1,0,0, 1,1,1,1,1};
int Z[] = {1,0,0,1,1, 1,0,1,0,1, 1,1,0,0,1};
int ex[] = {0,0,0,0,0, 1,1,1,0,1, 0,0,0,0,0};
int lp[] = {0,1,1,1,0, 1,0,0,0,1, 0,0,0,0,0};
int rp[] = {0,0,0,0,0, 1,0,0,0,1, 0,1,1,1,0};
/*
// Messages Array
char messages[11][16] = {
{C,O,L,L,E,G,E,_,O,A,K,_,W,A,R,D},
{C,O,L,L,E,G,E,_,O,A,K,_},
{T,I,M,_,B,A,L,L,A,S},
{T,H,E,_,C,O,W,S},
{C,A,M,P,_,N,A,U,V,O,O},
{W,E,L,C,O,M,E},
{H,E,L,L,O},
{C,O,W,S},
{T,O},
{_},
{ex}
};
*/
// Messages Array
const char* messages[11][16] = {
{"COLLEGE_OAK_WARD"},
{"COLLEGE_OAK"},
{"TIM_BALLAS"},
{"THE_COWS"},
{"CAMP_NAUVOO"},
{"WELCOME"},
{"HELLO"},
{"COWS"},
{"TO"},
{"_"},
{"ex"}
};
const int messagecombine[5][6] = {
{5,9,0}, // Welcome College Oak Ward
{5,9,8,9,4,10}, // Welcome To Camp Nauvoo!
{5,9,1,9,7,10}, // Welcome College Oak Cows!
{2}, // Tim Ballas
{3} // The Cows
};
int currchar = 0;
int letterSpace;
int dotTime;
void setup()
{
digitalWrite(PushbuttonPin,HIGH);
pinMode(PushbuttonPin,INPUT);
// setting the ports of the leds to OUTPUT
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
// defining the space between the letters (ms)
letterSpace = 6;
// defining the time dots appear (ms)
dotTime = 5;
Serial.begin(9600);
}
void printLetter(int letter[])
{
int y;
// printing the first y row of the letter
for (y=0; y<5; y++)
{
digitalWrite(y+2, letter[y]);
}
delay(dotTime);
// printing the second y row of the letter
for (y=0; y<5; y++)
{
digitalWrite(y+2, letter[y+5]);
}
delay(dotTime);
// printing the third y row of the letter
for (y=0; y<5; y++)
{
digitalWrite(y+2, letter[y+10]);
}
delay(dotTime);
// printing the sspace between the letters
for (y=0; y<5; y++)
{
digitalWrite(y+2, 0);
}
delay(letterSpace);
}
void loop()
{
reading = digitalRead(PushbuttonPin);
if(reading == HIGH && previous == LOW && millis() - time > debounce){
if(messageval == 4){
messageval = 0;
}
messageval = messageval++;
}
previous = reading;
for(int i=0; i < 6; i++){
int val = messagecombine[messageval][i];
for(int j=0; j < 16; j++){
currchar = atoi(messages[val][j]);
printLetter(currchar);
}
}
/*
// printing some letters
printLetter(H);
printLetter(E);
printLetter(L);
printLetter(L);
printLetter(O);
printLetter(_);
*/
}