#include <reg51.h> #define LED P2 sbit sw = P1^0; void delay(unsigned int ); main() { sw=1; LED=1; while(1) { if(sw==0) { LED=0; delay(10); LED=1; } } } void delay(unsigned int n) { TMOD= 0x01; // timer 0 mode 1 TH0=0xDC; TL=0x00; TR=1; while(TF==0); TF=0; TR=0; } When I compile this code in keil I am getting following errors Rebuild target 'Target 1' compiling switch.c... switch.c(24): error C202: 'TL': undefined identifier switch.c(25): error C202: 'TR': undefined identifier switch.c(26): error C202: 'TF': undefined identifier switch.c(27): error C202: 'TF': undefined identifier switch.c(28): error C202: 'TR': undefined identifier Target not created. Build Time Elapsed: 00:00:00 Any help could greatly appreciated..
Hi Umaganganger. try TL0 and TR0 which brings us back,as always, to WHICH CHIP?