*** ERROR L118: REFERENCE MADE TO ERRONEOUS EXTERNAL
#include<reg52.h> int i,j; bit state=0; sbit ledPin = P1^5; void main() { while(1) { ledPin = 1; for(i=0;i<1000;i++) { for(j=0;j<120;j++) { } } ledPin = 0; } }
Thx in Advance
Besides the original question, there are two things to consider here.
1) You know that software-only delay loops are dangerous? The compiler can remove them - or greatly change they delays - when you play with optimization levels or switch compiler verison/brand?
2) Are you sure that you only want a delay while pin is high - and no delay while pin is low?