Forverse – Reverse Control For CSS Compiler

#include <16F877.h> #device adc=8 #FUSES NOWDT ,XT #use delay(clock=4000000) void main() { setup_adc_ports(NO_ANALOGS); setup_adc(ADC_OFF); set_tris_a(0xff); set_tris_b(0x00); output_b(0x00); while(true){ if(!input(pin_a0)){ output_high(pin_b0); output_low(pin_b1); delay_ms(100); while(!input(pin_a0));} else if(!input(pin_a1)){ output_low(pin_b0); output_high(pin_b1); delay_ms(100); while(!input(pin_a ...

Read more

Forverse – Reverse Control For Basic PRO Compiler

@ device PIC16F877 define osc 4 define adc_bits 8 main: trisb =$00 trisa =$ff adcon1 = 7 sw1 var porta.0 sw2 var porta.1 sw3 var porta.2 lamp1 var portb.0 lamp2 var portb.1 lamp1=0 lamp2=0 while(1) if(!sw1 and sw2 and sw3) then repeat lamp1=1 lamp2=0 pause 10 until(!sw3):endif if(sw1 and !sw2 and sw3) then repeat lamp1=0 lamp2=1 pause 10 until(!sw3):endif if(sw1 and sw2 and !sw3) then repeat lamp1=0 lamp2=0 ...

Read more
Scroll to top