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);
    }
   }    
}

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter