Shift left – shift right value For Basic PRO Compiler

@ device pic16f877 define osc 4 define adc_bits 8 main: trisb =$00 trisa =$ff adcon1 = 7 lamp var portb sw1 var porta.0 sw2 var porta.1 lamp=0 while(1) if(!sw1) then gosub speed1 pause 50 endif if(!sw2) then gosub speed2 pause 50 endif pause 10 wend end speed1: lamp =$80 pause 200 while(sw2) lamp = lamp >> 1 ' shift right if lamp = $00 then lamp = $80 pause 200 wend return speed2: lamp =$01 pause 200 ...

Read more

Sound frequency For Basic PRO Compiler

@ device pic16f877 define osc 4 define adc_bits 8 main: trisb =$00 trisa =$ff adcon1 = 7 speaker var portb.0 sw1 var porta.0 flg_set var bit speaker =0 flg_set =0 while(1) if(!sw1) then pause 150 toggle flg_set while(!sw1):wend endif gosub sounds pause 10 wend end sounds: if(flg_set)then pause 10 sound speaker,[100,10]'100 =(1-127 generate frequency 78.74-10 khz ) '10 = constant time 12ms/1 = 120 ms else so ...

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

How to interface Servo Motor with PIC18F4550

Servo systems use the error sensing negative feedback method to provide precise angular motion. Servo Motors are used where precise control on angular motion is needed. Servo motors are widely used in the field of Robotics to design robotic arms, palms, legs and so on. They are also used in RC toys like RC helicopter, airplanes and cars. The interfacing of servo motor using PIC microcontroller has been expl ...

Read more

PIC18F4550 Programming and Tutorial Hardware C

PIC18F4550 Programming Tutorial in Hardware C PIC Tutorial , Mplab IDE - C18 compiler toolsuite PIC18F4550 tutorial, Looking the data sheet | Ports PIC18F4550 Programming method 1 Project Blink led PIC18F4550 Programming Method 2 Blink led PIC18F4550 Blink LED 20MHZ Oscillator | XC8 Mplab X IDE and XC8 compiler Blink LED PIC18F2550 programming: Blink LED | XC8 PIC18F4550 Programming Method 3 TRISB PIC18f455 ...

Read more
Scroll to top