858Views4Replies

Author Options:

make interface for sending text (using vb6) to a running led matrix arduino uno? Answered

i was succed to make my running led matrix using arduino uno, now i get trouble to make interfaceng for it (sending text etc).
thanks alot for your replay..

Discussions

0
user
PaulCo

6 years ago

Hi faisolhanif
i also would like to make led matrix 7*97
also would like to be able to talk to it via visual basic.
i am having problems running this code in arduino for windows 1.0
getting errors :

sketch_may14a.cpp:65:15: warning: missing whitespace after the macro name
sketch_may14a.cpp:66:16: warning: missing whitespace after the macro name
sketch_may14a.cpp:67:12: warning: missing whitespace after the macro name
sketch_may14a.cpp:68:13: warning: missing whitespace after the macro name
sketch_may14a.cpp:69:13: warning: missing whitespace after the macro name
sketch_may14a.cpp:70:17: warning: missing whitespace after the macro name
sketch_may14a.cpp:71:13: warning: missing whitespace after the macro name
sketch_may14a.cpp:72:14: warning: missing whitespace after the macro name
sketch_may14a.cpp: In function 'void display_word(int, byte (*)[10], int, int)':
sketch_may14a:109: error: expected `;' before 'for'
sketch_may14a:109: error: expected primary-expression before 'for'
sketch_may14a:109: error: expected `)' before 'for'
sketch_may14a:118: error: expected primary-expression before '>' token
sketch_may14a:118: error: expected `)' before ';' token
sketch_may14a:118: error: expected `)' before ';' token
sketch_may14a:120: error: expected `;' before 'for'
sketch_may14a:120: error: expected primary-expression before 'for'
sketch_may14a:120: error: expected `)' before 'for'
sketch_may14a.cpp: At global scope:
sketch_may14a:150: error: expected declaration before '}' token
please any help would be very much appreciated..

delete any "whitespace" text in the sketch

0
user
elabz

6 years ago

Does your Arduino code utilize the board's serial interface? If it does, you may not even need a separate "sender" program and can use Terminal or putty for sending the text. In fact, you could use Arduino's own IDE Serial Monitor (Ctrl+Shift+M) feature for that. it's even easier - less work setting up the serial port since the IDE already knows where your board is.

Here is my code to scrolling some text:
How do i can change or send some text to change the scrolling text using IDE Serial Monitor or VB6...thanks
#define A {B01111100,B10000010,B10000010,B10000010,B10000010,B11111110,B10000010,B10000010,B10000010,B10000010}
#define AA {B00000000,B00000000,B00000000,B00000000,B11110000,B00001000,B01111000,B10001000,B10001000,B01111000}
#define B {B01111000,B10000100,B10000010,B10000010,B10000100,B11111000,B10000100,B10000010,B10000100,B11111000}
#define BB {B00000000,B00000000,B10000000,B10000000,B10000000,B11110000,B10001000,B10001000,B10001000,B11110000}
#define C {B00111000,B01000100,B10000010,B10000000,B10000000,B10000000,B10000000,B10000010,B01000100,B00111000}
#define CC {B00000000,B00000000,B00000000,B00000000,B01110000,B10001000,B10000000,B10000000,B10001000,B01110000}
#define D {B11111000,B10000100,B10000010,B10000010,B10000010,B10000010,B10000010,B10000010,B10000100,B11111000}
#define DD {B00000000,B00000000,B00001000,B00001000,B00001000,B01111000,B10001000,B10001000,B10001000,B01111000}
#define E {B01111100,B10000000,B10000000,B10000000,B10000000,B11111000,B10000000,B10000000,B10000000,B01111100}
#define EE {B00000000,B00000000,B00000000,B00000000,B01110000,B10001000,B10001000,B11110000,B10000000,B01111000}
#define FF {B01111100,B10000000,B10000000,B10000000,B10000000,B11111000,B10000000,B10000000,B10000000,B10000000}
#define FFF {B00000000,B00000000,B01110000,B10000000,B10000000,B11100000,B10000000,B10000000,B10000000,B10000000}
#define G {B00111100,B01000010,B10000000,B10000000,B10000000,B10011110,B10000010,B10000010,B01000010,B00111100}
#define GG {B00000000,B00000000,B01111000,B10001000,B10001000,B10001000,B01111000,B00001000,B00001000,B11110000}
#define H {B10000010,B10000010,B10000010,B10000010,B10000010,B11111110,B10000010,B10000010,B10000010,B10000010}
#define HH {B00000000,B00000000,B10000000,B10000000,B10000000,B10000000,B11110000,B10001000,B10001000,B10001000}
#define I {B01111100,B00010000,B00010000,B00010000,B00010000,B00010000,B00010000,B00010000,B00010000,B01111100}
#define II {B00000000,B00000000,B01000000,B00000000,B11000000,B01000000,B01000000,B01000000,B01000000,B11100000}
#define J {B00001110,B00000010,B00000010,B00000010,B00000010,B00000010,B00000010,B01000010,B01000010,B00111100}
#define JJ {B00001000,B00000000,B00011000,B00001000,B00001000,B00001000,B00001000,B00001000,B01001000,B00110000}
#define K {B10000100,B10001000,B10010000,B10100000,B11000000,B11000000,B10100000,B10010000,B10001000,B10000100}
#define KK {B00000000,B00000000,B10001000,B10010000,B10100000,B11000000,B11000000,B10100000,B10010000,B10001000}
#define L {B10000000,B10000000,B10000000,B10000000,B10000000,B10000000,B10000000,B10000000,B10000000,B01111100}
#define LL {B00000000,B00000000,B10000000,B10000000,B10000000,B10000000,B10000000,B10000000,B10000000,B01110000}
#define M {B10000010,B11000110,B10101010,B10010010,B10010010,B10000010,B10000010,B10000010,B10000010,B10000010}
#define MM {B00000000,B00000000,B00000000,B00000000,B01000100,B10101010,B10010010,B10000010,B10000010,B10000010}
#define N {B10000010,B11000010,B10100010,B10100010,B10010010,B10010010,B10001010,B10001010,B10000110,B10000010}
#define NN {B00000000,B00000000,B00000000,B00000000,B11110000,B10001000,B10001000,B10001000,B10001000,B10001000}
#define O {B01111100,B10000010,B10000010,B10000010,B10000010,B10000010,B10000010,B10000010,B10000010,B01111100}
#define OO {B00000000,B00000000,B00000000,B00000000,B01110000,B10001000,B10001000,B10001000,B10001000,B01110000}
#define P {B11111000,B10000100,B10000100,B10000100,B11111000,B10000000,B10000000,B10000000,B10000000,B10000000}
#define PP {B00000000,B00000000,B11110000,B10001000,B10001000,B11110000,B10000000,B10000000,B10000000,B10000000}
#define Q {B01111100,B10000010,B10000010,B10000010,B10000010,B10000010,B10010010,B10010100,B10001000,B01110110}
#define QQ {B00000000,B00000000,B00000000,B00000000,B01110000,B10001000,B10001000,B10101000,B10010000,B01101000}
#define R {B11111000,B10000100,B10000100,B10000100,B11111000,B11000000,B10100000,B10010000,B10001000,B10000100}
#define RR {B00000000,B00000000,B00000000,B00000000,B01110000,B10000000,B10000000,B10000000,B10000000,B10000000}
#define ES {B01111110,B10000000,B10000000,B10000000,B01111100,B00000010,B00000010,B00000010,B00000010,B11111100}
#define ESS {B00000000,B00000000,B00000000,B00000000,B01110000,B10000000,B01100000,B00010000,B00010000,B11100000}
#define T {B11111110,B00010000,B00010000,B00010000,B00010000,B00010000,B00010000,B00010000,B00010000,B00010000}
#define TT {B00000000,B00000000,B10000000,B10000000,B10000000,B11100000,B10000000,B10000000,B10001000,B01110000}
#define U {B10000010,B10000010,B10000010,B10000010,B10000010,B10000010,B10000010,B10000010,B10000010,B01111100}
#define UU {B00000000,B00000000,B00000000,B00000000,B10001000,B10001000,B10001000,B10001000,B10001000,B01110000}
#define V {B10000010,B10000010,B10000010,B10000010,B10000010,B10000010,B01000100,B01000100,B00101000,B00010000}
#define VV {B00000000,B00000000,B00000000,B00000000,B10001000,B10001000,B10001000,B10001000,B01010000,B00100000}
#define W {B10000010,B10000010,B10000010,B10000010,B10010010,B10010010,B10010010,B10101010,B11000110,B10000010}
#define WW {B00000000,B00000000,B00000000,B00000000,B10000010,B10000010,B10000010,B10010010,B10101010,B01000100}
#define X {B10000010,B01000100,B00101000,B00101000,B00010000,B00010000,B00101000,B00101000,B01000100,B10000010}
#define XX {B00000000,B00000000,B00000000,B00000000,B10000100,B01001000,B00110000,B00110000,B01001000,B10000100}
#define Y {B10000010,B10000010,B01000100,B00101000,B00010000,B00010000,B00010000,B00010000,B00010000,B00010000}
#define YY {B00000000,B00000000,B10001000,B10001000,B10001000,B01111000,B00001000,B00001000,B10001000,B01110000}
#define Z {B11111110,B00000100,B00001000,B00001000,B00010000,B00010000,B00100000,B00100000,B01000000,B11111110}
#define ZZ {B00000000,B00000000,B00000000,B00000000,B11111000,B00001000,B00010000,B00100000,B01000000,B11111000}
#define angka1 {B01110000,B00010000,B00010000,B00010000,B00010000,B00010000,B00010000,B00010000,B00010000,B11111110}
#define angka2 {B01111100,B10000010,B00000010,B00000010,B00000100,B00001000,B00010000,B00100000,B01000000,B11111110}
#define angka3 {B01111100,B10000010,B00000010,B00000100,B00011000,B00000100,B00000010,B00000010,B10000010,B01111100}
#define angka4 {B00000110,B00001010,B00010010,B00100010,B01000010,B11111110,B00000010,B00000010,B00000010,B00000010}
#define angka5 {B11111110,B10000000,B10000000,B10000000,B01111100,B00000010,B00000010,B00000010,B00000010,B11111100}
#define angka6 {B01111100,B10000010,B10000000,B10000000,B11111100,B10000010,B10000010,B10000010,B10000010,B01111100}
#define angka7 {B11111110,B00000010,B00000010,B00000010,B00000100,B00001000,B00010000,B00100000,B01000000,B10000000}
#define angka8 {B01111100,B10000010,B10000010,B10000010,B01111100,B10000010,B10000010,B10000010,B10000010,B01111100}
#define angka9 {B01111100,B10000010,B10000010,B10000010,B10000010,B01111110,B00000010,B00000010,B10000010,B11111100}
#define angka0 {B01111100,B10000010,B10000010,B10000010,B10000010,B10000010,B10000010,B10000010,B10000010,B01111100}
#define slash {B00000010,B00000100,B00000100,B00001000,B00010000,B00010000,B00100000,B01000000,B01000000,B10000000}
#define apostrop {B00000011,B00000001,B00000010,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000}
#define DEVIDE{B00001000,B00010000,B00100000,B00100000,B01000000,B10000000}
#define TWODOTS{B01100000,B01100000,B00000000,B00000000,B01100000,B01100000}
#define DOT{B00000000,B00000000,B00000000,B00000000,B01100000,B01100000}
#define COMA{B00000000,B00000000,B00000000,B00110000,B00110000,B01100000}
#define LINE{B00000000,B00000000,B11111000,B11111000,B00000000,B00000000}
#define QUASTION{B01110000,B10001000,B00010000,B00100000,B00000000,B00100000}
#define MARK{B00100000,B01110000,B01110000,B00100000,B00000000,B00100000}
#define SPACE{B000000,B000000,B000000,B000000,B000000,B000000}

int latchPin = 10; //latch pin of the shift register
int clockPin = 13; //clock pin of the shift register
int dataPin = 11; //data pin of the shift register
int clock = 9; //clock pin of the 4017 counter
int Reset = 8; //reset pin of the 4017 counter

// setting the pins for easy operation with PORTB
int latchPinPORTB = latchPin - 8;
int clockPinPORTB = clockPin - 8;
int dataPinPORTB = dataPin - 8;
int i = 0;
int const panjang=65;
#define teks {ES,EE,LL,AA,MM,AA,TT,SPACE,D,AA,TT,AA,NN,GG,SPACE,DD,II,SPACE,M,A,D,I,N,slash,SPACE,M,T,ESS,slash,M,A,SPACE,M,I,FF,T,A,H,U,L,SPACE,H,U,D,A,SPACE,K,A,N,G,K,U,N,G,SPACE,K,R,A,J,A,N}
byte scrolling_word[100][10];// this is for the scrolling text
int array_turn=0;
byte your_text[panjang][10]=teks;


void setup(){
Serial.begin(9600);//starting communicatino with the PC at 9600 boud
// config for all the pins
pinMode(dataPin,OUTPUT);
pinMode(clockPin,OUTPUT);
pinMode(latchPin,OUTPUT);
pinMode(clock,OUTPUT);
pinMode(Reset,OUTPUT);
//reseting the 4017 counter
digitalWrite(Reset,HIGH);
digitalWrite(Reset,LOW);
setupSPI();//starting SPI communication
}

void display_word(int loops,byte word_print[][10],int num_patterns,int delay_langth){ // the main funcion for displaying and scrolling the word
i = 0;


for(int x=0;x for(int scroll=0;scroll<10;scroll++){// loop for scrolling, each symbols scrolls for 6 columns
for(int r=0;r<10;r++){//going over all of the rows
scrolling_word[r][7] = (scrolling_word[r][7] << 1)+((scrolling_word[r][6] & 0x80) >> 7);
scrolling_word[r][6] = (scrolling_word[r][6] << 1)+((scrolling_word[r][5] & 0x80) >> 7);
scrolling_word[r][5] = (scrolling_word[r][5] << 1)+((scrolling_word[r][4] & 0x80) >> 7);
scrolling_word[r][4] = (scrolling_word[r][4] << 1)+((scrolling_word[r][3] & 0x80) >> 7);
scrolling_word[r][3] = (scrolling_word[r][3] << 1)+((scrolling_word[r][2] & 0x80) >> 7);
scrolling_word[r][2] = (scrolling_word[r][2] << 1)+((scrolling_word[r][1] & 0x80) >> 7);
scrolling_word[r][1] = (scrolling_word[r][1] << 1)+((scrolling_word[r][0] & 0x80) >> 7);
scrolling_word[r][0] = (scrolling_word[r][0] << 1)+(((word_print[x][r]<>7);
}
for(int t=0;t for(int y=0;y<10;y++){// the scaning loop that goes over all 6 rows

latchOff();// starint the communication with the shift registers
spi_transfer(scrolling_word[y][7]);
spi_transfer(scrolling_word[y][6]);
spi_transfer(scrolling_word[y][5]);
spi_transfer(scrolling_word[y][4]);
spi_transfer(scrolling_word[y][3]);
spi_transfer(scrolling_word[y][2]);
spi_transfer(scrolling_word[y][1]);
spi_transfer(scrolling_word[y][0]);
latchOn();
//delayMicroseconds(700);//a small delay for each row
latchOff();// clearing the shift registers to make sure we will not get a ghosting effect
spi_transfer(0);
spi_transfer(0);
spi_transfer(0);
spi_transfer(0);
spi_transfer(0);
spi_transfer(0);
spi_transfer(0);
spi_transfer(0);
latchOn();
// advensing the 4017 counter by one( we just send a positive pulse)
digitalWrite(clock,HIGH);
digitalWrite(clock,LOW);
i++;
}
}
}
}

}


void loop()
{
display_word(1,your_text,panjang,100);
}


void latchOn(){
bitSet(PORTB,latchPinPORTB);
}

void latchOff(){
bitClear(PORTB,latchPinPORTB);

}


void setupSPI(){// setting all the registers for SPI cummunication
byte clr;
SPCR |= ( (1< //SPCR |= ( (1< SPCR &= ~( (1< clr=SPSR; // clear SPI status reg
clr=SPDR; // clear SPI data reg
SPSR |= (1< //SPSR &= ~(1<
delay(10);
}
byte spi_transfer(byte data)
{
SPDR = data; // Start the transmission
while (!(SPSR & (1< {
};
return SPDR; // return the received byte, we don't need that
}