Home > other >  Single chip microcomputer
Single chip microcomputer

Time:09-16

Excuse me, where is the wrong

CodePudding user response:

You are the p20 use wrong
Led=P2 ^ 0;

CodePudding user response:

P is usually uppercase, and IO mouth are numbered, beginning P0,

CodePudding user response:

Error: error LED does not define
So to define the LED is a first operation
Previously used C51 line should remember this:

Unsigned char bdata p
Sbit led=p ^ 7//p ^ 7 value is 0, 7

CodePudding user response:

Do a port up to eight, values can only be 0 ~ 7

Sbit led=P0 ^ N ; N=0 ~ 7 in a value
  • Related