Wye-delta Motor Controll For CSS Compiler




#include <16F877.h>
#device adc=8
#FUSES NOWDT ,XT                                        
#use delay(clock=4000000) 
#define S1 pin_a0
#define S2 pin_a1  
#define S3 pin_a2 
#define K1 pin_b0
#define K2 pin_b1
#define K3 pin_b2
void main()
{
setup_adc_ports(NO_ANALOGS);
setup_adc(ADC_OFF);
set_tris_e(0xff); // input 
set_tris_b(0x00); // output
output_b(0x00);   // initial output = 0; 
while(true)
{
if(!input(S1))
{
output_high(K1);
output_high(K2);
output_low(K3);
delay_ms(5000);      
while(input(S2))
{
output_high(K1);
output_low(K2);
output_high(K3);
delay_ms(50);
}
}
else
{
output_low(K1);
output_low(K2);
output_low(K3);
delay_ms(50);
}
}    
}




READ  Shift left - shift right value For CSS Compiler

Leave a Comment

*
= 5 + 9

Read previous post:
Sound frequency For CSS Compiler

#include <16F877.h> #device adc=8 #FUSES NOWDT ,XT #use delay(clock=4000000) void sound (char freq,int16 time) // Sound Generate { unsigned char...

Close
Scroll to top