unsigned char gcan[5] = {0b01110010,0b11011000,0b00011011,0b10010010,0b01101100};
void countdown()
{
const unsigned char position = 0;
unsigned char i, j;
for (i = 0; i <= 7; i++)
{
for (j = 0; j <= 4; j++)
{
//Style 1
//gcan[position + j] = ((gcan[position + j] << 1));
//gcan[position + j] |= 0x01;
//Style 2
gcan[position + j] = ((gcan[position + j]) << 1) | 0x01;
}
}
}
gcan[position + j] = ((gcan[position + j]) << 1) | 0x01;
gcan[position + j] = ((gcan[position + j]) << 1);
gcan[position + j] = ((gcan[position + j]) << 1) | 0xF0;
//if you use this ORring works.. but not working with 0x01 infact anding also works..
gcan[position + j] = ((gcan[position + j]) << 1);
gcan[position + j] |= 0x01;
gcan[position + j] = ((gcan[position + j]) << 1) | 0x01;
unsigned char gcan[5] = {0b01110010,0b11011000,0b00011011,0b10010010,0b01101100};
unsigned char jcan[5] = {0b01110010,0b11011000,0b00011011,0b10010010,0b01101100};
void main()
{
const unsigned char position = 0;
unsigned char i, j;
for (i = 0; i <= 7; i++)
{
for (j = 0; j <= 4; j++)
{
//Style 1
jcan[position + j] = ((jcan[position + j] << 1));
jcan[position + j] |= 0x01;
//Style 2
gcan[position + j] = ((gcan[position + j]) << 1) | 0x01;
//Position A
}
}
}
//**********************************************************************************
//Configuration Bits
__CONFIG(HS & WDTDIS & PWRTEN & MCLREN & UNPROTECT & SWBOREN & IESODIS & FCMDIS & LVPDIS & DEBUGDIS); //1st config. Word
__CONFIG(BORV21); //2st config. Word*/
//**********************************************************************************
//
// Configuration mask definitions
//
// Config Register: CONFIG
#define CONFIG 0x2007
// Oscillator Selection bits
// RC oscillator
#define FOSC_EXTRC 0xFFFF
// HS oscillator
#define FOSC_HS 0xFFFE
// XT oscillator
#define FOSC_XT 0xFFFD
// LP oscillator
#define FOSC_LP 0xFFFC
// Watchdog Timer Enable bit
// WDT enabled
#define WDTE_ON 0xFFFF
// WDT disabled
#define WDTE_OFF 0xFFFB
// Power-up Timer Enable bit
// PWRT disabled
#define PWRTE_OFF 0xFFFF
// PWRT enabled
#define PWRTE_ON 0xFFF7
// FLASH Program Memory Code Protection bits
// Code protection off
#define CP_OFF 0xFFFF
// 1F00h to 1FFFh code protected
#define CP_UPPER_256 0xEFEF
// 1000h to 1FFFh code protected
#define CP_HALF 0xDFDF
// 0000h to 1FFFh code protected
#define CP_All 0xCFCF
// Brown-out Reset Enable bit
// BOR enabled
#define BOREN_ON 0xFFFF
// BOR disabled
#define BOREN_OFF 0xFFBF
// Low Voltage In-Circuit Serial Programming Enable bit
// RB3/PGM pin has PGM function; low-voltage programming enabled
#define LVP_ON 0xFFFF
// RB3 is digital I/O, HV on MCLR must be used for programming
#define LVP_OFF 0xFF7F
// Data EE Memory Code Protection
// Code Protection off
#define CPD_OFF 0xFFFF
// Data EEPROM memory code-protected
#define CPD_ON 0xFEFF
// FLASH Program Memory Write Enable
// Unprotected program memory may be written to by EECON control
#define WRT_ON 0xFFFF
// Unprotected program memory may not be written to by EECON control
#define WRT_OFF 0xFDFF
// In-Circuit Debugger Mode bit
// In-Circuit Debugger disabled, RB6 and RB7 are general purpose I/O pins
#define DEBUG_OFF 0xFFFF
// In-Circuit Debugger enabled, RB6 and RB7 are dedicated to the debugger
#define DEBUG_ON 0xF7FF
gcan[position + j] = ((gcan[position + j]) << 1) | 0x01;
gcan[position + j] = ((gcan[position + j]) << 1) + 0x01;
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?