1980 views|10 replies

6

Posts

0

Resources
The OP
 

I am a beginner who just learned 51. I would like to ask the experts to see if there is any problem with the program of the water lamp. [Copy link]

 
#include "reg52.h" #include typedef unsigned int u16; typedef unsigned char u8;void delay(u16 z);sbit P10=P1^0;#define led P10;void delay(u16 i);{ while(i--); }void main(){ u8 i; led=~0x01; delay(50000); while(1) { for(i=0;i<7;i++) { P10=~(0x01<0;i--) {if(i%2 != 0) P10=~(0x01<0;i--){P10=~(0x01<
#include "reg52.h" #include typedef unsigned int u16; typedef unsigned char u8;void delay(u16 z);sbit P10=P1^0;#define led P10;void delay(u16 i);{ while(i--); }void main(){ u8 i; led=~0x01; delay(50000); while(1) { for(i=0;i<7;i++) { P10=~(0x01<0;i--) {if(i%2 != 0) P10=~(0x01<0;i--){P10=~(0x01<
#include "reg52.h" #include typedef unsigned int u16; typedef unsigned char u8;void delay(u16 z);sbit P10=P1^0;#define led P10;void delay(u16 i);{ while(i--); }void main(){ u8 i; led=~0x01; delay(50000); while(1) { for(i=0;i<7;i++) { P10=~(0x01<0;i--) {if(i%2 != 0) P10=~(0x01<0;i--){P10=~(0x01<
This is an error message
This is an error message
rrr.c(11): error C141: syntax error near '{' rrr.c(12): error C141: syntax error near '--', expected ')' rrr.c(18): error C141: syntax error near '='

When pasting the code, pay attention to the format.

P10=~(0x01<0;i--) This assignment operation is incorrect. There is no semicolon after the copy operation. P10=~(0x01<0);i--; Also, what is 0x01<0 for? Left shift is not this operator. I don't know what you wrote.

#include "reg52.h"
#include 
typedef unsigned int u16;
typedef unsigned char u8;
void delay(u16 z);
sbit P10=P1^0;
#define led P10;
void delay(u16 i);
{
    while(i--);
}
void main(){
    u8 i;
    led=~0x01;
    delay(50000);
    while(1) {
        for(i=0;i<7;i++) {
            P10=~(0x01<0;i--) {
                if (i%2 != 0) 
                    P10=~(0x01<0;i--) {
                        P10=~(0x01<

It is best not to use i-- in the for loop, as it will cause confusion

Yours is lit at low level, can you tell me what this means? P10=~(0x01<0;i--) The left shift symbol should be: "《"

I am a beginner who just learned 51. I would like to ask the experts to see if there is any problem with the program of the water lamp.
This post is from 51mcu

Latest reply

Yours is lit at low level, can you tell me what this means? P10=~(0x01<0;i--) The left shift symbol should be: "《"   Details Published on 2019-7-4 15:00
 

6

Posts

0

Resources
2
 
#include "reg52.h" #include typedef unsigned int u16; typedef unsigned char u8;void delay(u16 z);sbit P10=P1^0;#define led P10;void delay(u16 i);{ while(i--); }void main(){ u8 i; led=~0x01; delay(50000); while(1) { for(i=0;i<7;i++) { P10=~(0x01<0;i--) {if(i%2 != 0) P10=~(0x01<0;i--){P10=~(0x01<
#include "reg52.h" #include typedef unsigned int u16; typedef unsigned char u8;void delay(u16 z);sbit P10=P1^0;#define led P10;void delay(u16 i);{ while(i--); }void main(){ u8 i; led=~0x01; delay(50000); while(1) { for(i=0;i<7;i++) { P10=~(0x01<0;i--) {if(i%2 != 0) P10=~(0x01<0;i--){P10=~(0x01<
This is an error message
This is an error message
rrr.c(11): error C141: syntax error near '{' rrr.c(12): error C141: syntax error near '--', expected ')' rrr.c(18): error C141: syntax error near '='

When pasting the code, pay attention to the format.

P10=~(0x01<0;i--) This assignment operation is incorrect. There is no semicolon after the copy operation. P10=~(0x01<0);i--; Also, what is 0x01<0 for? Left shift is not this operator. I don't know what you wrote.

#include "reg52.h"
#include 
typedef unsigned int u16;
typedef unsigned char u8;
void delay(u16 z);
sbit P10=P1^0;
#define led P10;
void delay(u16 i);
{
    while(i--);
}
void main(){
    u8 i;
    led=~0x01;
    delay(50000);
    while(1) {
        for(i=0;i<7;i++) {
            P10=~(0x01<0;i--) {
                if (i%2 != 0) 
                    P10=~(0x01<0;i--) {
                        P10=~(0x01<

It is best not to use i-- in the for loop, as it will cause confusion

Yours is lit at low level, can you tell me what this means? P10=~(0x01<0;i--) The left shift symbol should be: "《"

I am a beginner who just learned 51. I would like to ask the experts to see if there is any problem with the program of the water lamp.
This post is from 51mcu
 
 
 

6

Posts

0

Resources
3
 
#include "reg52.h" #include typedef unsigned int u16; typedef unsigned char u8;void delay(u16 z);sbit P10=P1^0;#define led P10;void delay(u16 i);{ while(i--); }void main(){ u8 i; led=~0x01; delay(50000); while(1) { for(i=0;i<7;i++) { P10=~(0x01<0;i--) {if(i%2 != 0) P10=~(0x01<0;i--){P10=~(0x01<
This is an error message
This is an error message
rrr.c(11): error C141: syntax error near '{' rrr.c(12): error C141: syntax error near '--', expected ')' rrr.c(18): error C141: syntax error near '='

When pasting the code, pay attention to the format.

P10=~(0x01<0;i--) This assignment operation is incorrect. There is no semicolon after the copy operation. P10=~(0x01<0);i--; Also, what is 0x01<0 for? Left shift is not this operator. I don't know what you wrote.

#include "reg52.h"
#include 
typedef unsigned int u16;
typedef unsigned char u8;
void delay(u16 z);
sbit P10=P1^0;
#define led P10;
void delay(u16 i);
{
    while(i--);
}
void main(){
    u8 i;
    led=~0x01;
    delay(50000);
    while(1) {
        for(i=0;i<7;i++) {
            P10=~(0x01<0;i--) {
                if (i%2 != 0) 
                    P10=~(0x01<0;i--) {
                        P10=~(0x01<

It is best not to use i-- in the for loop, as it will cause confusion

Yours is lit at low level, can you tell me what this means? P10=~(0x01<0;i--) The left shift symbol should be: "《"

I am a beginner who just learned 51. I would like to ask the experts to see if there is any problem with the program of the water lamp.
This post is from 51mcu
 
 
 

6

Posts

0

Resources
4
 
This is an error message
This post is from 51mcu
 
 
 

6

Posts

0

Resources
5
 
This is an error message
This post is from 51mcu
 
 
 

6

Posts

0

Resources
6
 
rrr.c(11): error C141: syntax error near '{'
rrr.c(12): error C141: syntax error near '--', expected ')'
rrr.c(18): error C141: syntax error near '='
This post is from 51mcu
 
 
 

5979

Posts

8

Resources
7
 

When pasting the code, pay attention to the format.

This post is from 51mcu
 
Personal signature生活就是油盐酱醋再加一点糖,快活就是一天到晚乐呵呵的忙
===================================
做一个简单的人,踏实而务实,不沉溺幻想,不庸人自扰
 
 

875

Posts

1

Resources
8
 
  P10=~(0x01<0;i--) This assignment operation is incorrect. There is no semicolon after the copy operation. P10=~(0x01<0);i--; Also, what is 0x01<0 for? Left shift is not this operator. I don't know what you wrote.
This post is from 51mcu
 
 
 

7422

Posts

2

Resources
9
 

#include "reg52.h"
#include 
typedef unsigned int u16;
typedef unsigned char u8;
void delay(u16 z);
sbit P10=P1^0;
#define led P10;
void delay(u16 i);
{
    while(i--);
}
void main(){
    u8 i;
    led=~0x01;
    delay(50000);
    while(1) {
        for(i=0;i<7;i++) {
            P10=~(0x01<0;i--) {
                if (i%2 != 0) 
                    P10=~(0x01<0;i--) {
                        P10=~(0x01<

This post is from 51mcu
 
Personal signature

默认摸鱼,再摸鱼。2022、9、28

 
 

4005

Posts

0

Resources
10
 

It is best not to use i-- in the for loop, as it will cause confusion

This post is from 51mcu
 
 
 

291

Posts

0

Resources
11
 

Yours is lit at low level, can you tell me what this means? P10=~(0x01<0;i--) The left shift symbol should be: "《"

This post is from 51mcu
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list