andre abelian wrote: > I need to generate 2 pulses one of them is inverted. .... I use > this to create first pulse > > Led1^=0x01; // this will toggle the bit > > Now second one I need to xor and invert > > Led2^=0x01; > Led2=(~led2); // this line generates an error I know it is wrong > > But instead I did this it works but it is long > > if (topga==0) > { > topga=1; > bottomga=0; > } > else if (topga==1) > { > bottomga=1; > topga=0; > } Andre: Is this what you're trying to do? LED2 = LED1; LED1 ^= 0x01; -Andy === Andrew Warren -- aiw@cypress.com === Principal Design Engineer === Cypress Semiconductor Corporation === === Opinions expressed above do not === necessarily represent those of === Cypress Semiconductor Corporation -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body