plz help me to solve this coding problem.
I need to scroll LED matrix display to this direction "<--- " but it is working on up direction (U+2195) ,hear i have attach my code with proteus simulation which i used. plz any one could help me to modify this code work <--- direction .
( I have used PIC 16f887 & MPLABX)
#define _XTAL_FREQ 8000000
#include <stdio.h>
#include <stdlib.h>
#include <xc.h>
#include <math.h>
#define SRCLK RD0
#define SER RD1
#define RCLK RD2
#define REST RD4
#pragma config FOSC = HS // Oscillator Selection bits (HS oscillator: High-speed crystal/resonator on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN)
#pragma config WDTE = OFF // Watchdog Timer Enable bit (WDT disabled and can be enabled by SWDTEN bit of the WDTCON register)
#pragma config PWRTE = OFF // Power-up Timer Enable bit (PWRT disabled)
#pragma config MCLRE = ON // RE3/MCLR pin function select bit (RE3/MCLR pin function is MCLR)
#pragma config CP = OFF // Code Protection bit (Program memory code protection is disabled)
#pragma config CPD = OFF // Data Code Protection bit (Data memory code protection is disabled)
#pragma config BOREN = ON // Brown Out Reset Selection bits (BOR enabled)
#pragma config IESO = ON // Internal External Switchover bit (Internal/External Switchover mode is enabled)
#pragma config FCMEN = ON // Fail-Safe Clock Monitor Enabled bit (Fail-Safe Clock Monitor is enabled)
#pragma config LVP = ON // Low Voltage Programming Enable bit (RB3/PGM pin has PGM function, low voltage programming enabled)
// CONFIG2
#pragma config BOR4V = BOR40V // Brown-out Reset Selection bit (Brown-out Reset set to 4.0V)
#pragma config WRT = OFF // Flash Program Memory Self Write Enable bits (Write protection off)
void clock (void){RD3=1;RD3=0;}
void reset (void){ REST =1; REST =0; }
void serial_data_inn(unsigned long temp);
void LED_ON (unsigned int k);
void LED_SHIFT(unsigned char shiftt[][8]);
char Array[16];int L=15; unsigned long F;
unsigned int scroll_LED[2][8];unsigned long scroll_LED2[8];
int main(){
TRISD=0;
PORTD=0;
const unsigned char lETTER_E[][8]={
{0b00000000,0b11111110,0b10010010,0b10010010,0b10010010,0b10010010,0b00000000,0b00000000},//E
{0b00000000,0b11111110,0b00000010,0b00000010,0b00000010,0b00000010,0b00000000,0b00000000},//L
{0b00000000,0b11111110,0b10010010,0b10010010,0b10010010,0b10010010,0b00000000,0b00000000},//E
{0b00000000,0b00111100,0b01000010,0b01000010,0b01000010,0b01000010,0b00000000,0b00000000},//C
{0b00000000,0b01000000,0b01000000,0b01111110,0b01000000,0b01000000,0b00000000,0b00000000},//T
{0b00000000,0b11111111,0b10001000,0b10001100,0b10001010,0b01110001,0b00000000,0b00000000},//R
{0b00000000,0b00111100,0b01000010,0b01000010,0b01000010,0b00111100,0b00000000,0b00000000},//O
{0b00000000,0b01111110,0b00100000,0b00010000,0b00001000,0b00000100,0b01111110,0b00000000},//N
{0b00000000,0b10000001,0b10000001,0b11111111,0b10000001,0b10000001,0b00000000,0b00000000},//I
{0b00000000,0b00111100,0b01000010,0b01000010,0b01000010,0b01000010,0b00000000,0b00000000},//C
{0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000},//ZERO
{0b00000000,0b11111110,0b00000010,0b00000010,0b00000010,0b00000010,0b00000000,0b00000000},//L
{0b00000000,0b01111110,0b10001000,0b10001000,0b10001000,0b10001000,0b01111110,0b00000000},//A
{0b00000000,0b01111111,0b01001001,0b01001001,0b01001001,0b01001001,0b00110110,0b00000000},//B
{0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000}//ZERO
};
while(1){
LED_SHIFT(lETTER_E);
}
}
void serial_data_inn(unsigned long temp ){
unsigned long Mask = 0x0001;
for (int i=0;i<32;i++){
F = temp & Mask;
SRCLK =0;
if (F != 0){
SER=1; }
else {
SER=0; }
SRCLK =1;
Mask = Mask << 1;
}
RCLK=1;
RCLK=0;
}
/*void LED_ON (unsigned int k){
char c=0 ;
for (int i=0;i<16;i++){
Array
=0;
}
while (k != 0)
{
Array[c] = k & 0x01;
k =k >>1;
c++;
}
}
*/
void LED_SHIFT(unsigned char shiftt[][8]){
for (unsigned char a=0;a<L;a++){
for(char k=0;k<8;k++){
for(unsigned char j=0; j<8;j++) {
scroll_LED2[j]=scroll_LED2[j] << 1 | (shiftt[a][j]>>((8-1)-k*1) ) ;
}
for(int b=0;b <5; b++){
for (int i=0;i<8;i++){
serial_data_inn(scroll_LED2);
__delay_us(2000);
serial_data_inn(0b00000000000000000000000000000000);
clock();
}
reset();
}
}
if (a>(L -1)){for(char d=0;d<8;d++){ scroll_LED2[d]=0 ;} }
}
}