Create code that will blink led 1 connected to pin 0 port C

Create code that will blink led 1 (connected to pin 0 port C) 50 times at 30 Hz. Assume you have a delay function called delay_xms(x) that will delay x ms. Ex delay_xms(5); delay for 5ms. Assuming pin C1 has already been initalized as an output.

Solution

#include sbit LED = C1^0; // Defining LED pin void Delay(void); // Function prototype declaration void main () { int i; for( i=0;i<=50;i++) // infinite loop { LED = 0; // LED ON delay_xms(5); LED = 1; // LED OFF delay_xms(5); } } int Delay(int x) { int j; int i; for(i=0;i<10;i++) { for(j=0;j
Create code that will blink led 1 (connected to pin 0 port C) 50 times at 30 Hz. Assume you have a delay function called delay_xms(x) that will delay x ms. Ex d

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site