//include file #include //16F84 configuration __CONFIG(0x3FF1); //main function void main(void) { //this function generates a sine wave while(1) { //starts at 0 PORTB=0b00010000; //start up PORTB=0b10010000; PORTB=0b01010000; PORTB=0b11010000; PORTB=0b00110000; PORTB=0b10110000; PORTB=0b01110000; PORTB=0b11110000; //sine peaks PORTB=0b01110000; //back down PORTB=0b10110000; PORTB=0b00110000; PORTB=0b11010000; PORTB=0b01010000; PORTB=0b10010000; PORTB=0b00010000; //back at the center PORTB=0b11100000; //start down PORTB=0b01100000; PORTB=0b10100000; PORTB=0b00100000; PORTB=0b11000000; PORTB=0b01000000; PORTB=0b10000000; PORTB=0b00000000; //sine bottoms out PORTB=0b10000000; //back up PORTB=0b01000000; PORTB=0b11000000; PORTB=0b00100000; PORTB=0b10100000; PORTB=0b01100000; PORTB=0b11100000; //PORTB=0b00010000; back to 0, commented out to prevent a pause } }