Shift left – shift right value For CSS Compiler




  
#include <16F877.h>
#device adc=8
#FUSES NOWDT ,XT                                        
#use delay(clock=4000000) 
int8 x,k;
void main()
{
   setup_adc_ports(NO_ANALOGS);
   setup_adc(ADC_OFF);
   setup_psp(PSP_DISABLED);
   setup_spi(SPI_SS_DISABLED);
   setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
   setup_timer_1(T1_DISABLED);
   setup_timer_2(T2_DISABLED,0,1); 
   set_tris_b(0x00);
   output_b(0);
   k=0;
   x=0x01;
    while(true)
   {
     for(k=0;k<=7;++k){
      output_b (x);
      delay_ms(150);
      shift_left(&x,1,0);
       }
        x = 0x80;
        k = 0;
      for(k=0;k<=7;++k){
      output_b (x);
      delay_ms(150);
      shift_right(&x,1,0);  
      }
        x = 0x01;
        k = 0;
        }
}




Current Project / Post can also be found using:

  • ccs c shift left
  • in lcd how to shift the value right in one by one using ccs compiler
  • lcd shift commands in ccs

Leave a Comment

*
= 3 + 2

Read previous post:
One wire bus (DS1820) Control For Basic PRO Compiler

Include "modedefs.bas" @ Device PIC16F877,XT_OSC,WDT_off,PWRT_off,PROTECT_off ,BOD_Off define adc_bits 8 define osc 4 DEFINE LCD_DREG PORTD DEFINE LCD_DBIT 4 DEFINE LCD_RSREG...

Close
Scroll to top