欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 2047|回復: 7
打印 上一主題 下一主題
收起左側

請問這個單片機C語言程序有什么問題嗎為什么顯示重復定義呢?

[復制鏈接]
跳轉到指定樓層
樓主
ID:1013408 發表于 2022-3-27 11:01 來自觸屏版 | 只看該作者 |只看大圖 回帖獎勵 |倒序瀏覽 |閱讀模式
頭文件是#include<reg52.h>
以及前期有一個數碼管位選的定義,是這兩者沖突了嗎

5([[AZ${V$C_R%0@AZOOY6W(1).png (33.19 KB, 下載次數: 24)

5([[AZ${V$C_R%0@AZOOY6W(1).png

N[FIP51hei~JG4ASV1)9`_S9[9(1).png (175.06 KB, 下載次數: 34)

N[FIP51hei~JG4ASV1)9`_S9[9(1).png
分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享淘帖 頂 踩
回復

使用道具 舉報

沙發
ID:161164 發表于 2022-3-27 12:33 | 只看該作者
應該是前面有錯字/錯符號/半型符號
你不發全部代就自己檢查
回復

使用道具 舉報

板凳
ID:883242 發表于 2022-3-27 18:57 | 只看該作者
前面定義smg_we4那部分貼出來。
回復

使用道具 舉報

地板
ID:121859 發表于 2022-3-27 19:06 | 只看該作者
smg_we4重復定義了,應該有至少兩個地方定義了這個變量。
回復

使用道具 舉報

5#
ID:1013408 發表于 2022-3-29 17:38 | 只看該作者
lkc8210 發表于 2022-3-27 12:33
應該是前面有錯字/錯符號/半型符號
你不發全部代就自己檢查

好的謝謝
回復

使用道具 舉報

6#
ID:1013408 發表于 2022-3-29 17:40 | 只看該作者
#include<reg52.h>                  //#define uchar unsigned char   //#define unit unsigned int        // ////uchar smg_du[] = {0x40, 0x75, 0x0c, 0x14, 0x31, 0x12, 0x02, 0x74, 0x00, 0x10,  //                                                                           0x20, 0x03, 0x4a, 0x05, 0x0a, 0x2a, 0xff};  //uchar dis_smg[8] = {0xc0, 0xfa, 0xa4, 0xb0, 0x99, 0x92, 0x82, 0xf8};uchar smg_i = 4;     //uchar flag_che;       ////sbit smg_we1 = P2^0;      //sbit smg_we2 = P2^1;  sbit smg_we3= P3^6;  sbit smg_we4= P3^7;  char dx_s = 0;                       //sbit dx_red = P2^4;              //sbit dx_green = P2^3;          //sbit dx_yellow = P2^2;         //sbit nb_red = P2^7;              //sbit nb_green = P2^6;          //sbit nb_yellow = P2^5;         //sbit nb_che = P3^3;           //sbit dx_che = P3^4;           //uint ;nb_che_value;uint  ;dx_che_value;uchar xdata nb[30];uchar xdata dx[30];uchar flag_jtd_mode;        //bit flag_1s = 0;bit flag_500ms;bit flag_dx_nb = 0;uchar flag_5m_value;uchar i;uchar flag_alarm;              //uchar dx_time = 30, nb_time = 20;    //uchar flag_jdgz;                  //uchar miao, miao 1;  /....................................................                 ............................................../void smg_we_switch(uchar i){      switch (i)             {                          case 0: smg_we1= 0;   smg_we2 = 1;   smg_we3 = 1;  smg_we4 =1;   break;                             case 1: smg_we1= 1;   smg_we2 = 0;   smg_we3 = 1;  smg_we4 =1;   break;                             case 2: smg_we1= 1;   smg_we2 = 1;   smg_we3 = 0;  smg_we4 =1;   break;                              case 3: smg_we1= 1;   smg_we2 = 1;   smg_we3 = 1;  smg_we4 =0;   break;                  }}#include<reg52.h>                  //#define uchar unsigned char   //#define unit unsigned int        // ////uchar smg_du[] = {0x40, 0x75, 0x0c, 0x14, 0x31, 0x12, 0x02, 0x74, 0x00, 0x10,  //                                                                           0x20, 0x03, 0x4a, 0x05, 0x0a, 0x2a, 0xff};  //uchar dis_smg[8] = {0xc0, 0xfa, 0xa4, 0xb0, 0x99, 0x92, 0x82, 0xf8};uchar smg_i = 4;     //uchar flag_che;       ////sbit smg_we1 = P2^0;      //sbit smg_we2 = P2^1;  sbit smg_we3= P3^6;  sbit smg_we4= P3^7;  char dx_s = 0;                       //sbit dx_red = P2^4;              //sbit dx_green = P2^3;          //sbit dx_yellow = P2^2;         //sbit nb_red = P2^7;              //sbit nb_green = P2^6;          //sbit nb_yellow = P2^5;         //sbit nb_che = P3^3;           //sbit dx_che = P3^4;           //uint ;nb_che_value;uint  ;dx_che_value;uchar xdata nb[30];uchar xdata dx[30];uchar flag_jtd_mode;        //bit flag_1s = 0;bit flag_500ms;bit flag_dx_nb = 0;uchar flag_5m_value;uchar i;uchar flag_alarm;              //uchar dx_time = 30, nb_time = 20;    //uchar flag_jdgz;                  //uchar miao, miao 1;  /....................................................                 ............................................../void smg_we_switch(uchar i){      switch (i)             {                          case 0: smg_we1= 0;   smg_we2 = 1;   smg_we3 = 1;  smg_we4 =1;   break;                             case 1: smg_we1= 1;   smg_we2 = 0;   smg_we3 = 1;  smg_we4 =1;   break;                             case 2: smg_we1= 1;   smg_we2 = 1;   smg_we3 = 0;  smg_we4 =1;   break;                              case 3: smg_we1= 1;   smg_we2 = 1;   smg_we3 = 1;  smg_we4 =0;   break;                  }}
回復

使用道具 舉報

7#
ID:1013408 發表于 2022-3-29 17:44 | 只看該作者
zhxiufan 發表于 2022-3-27 19:06
smg_we4重復定義了,應該有至少兩個地方定義了這個變量。

emmm好的謝謝
回復

使用道具 舉報

8#
ID:1013408 發表于 2022-3-29 17:46 | 只看該作者
Hephaestus 發表于 2022-3-27 18:57
前面定義smg_we4那部分貼出來。

emmm好的謝謝!代碼有些長,從快速回復那里粘貼了代碼不知道是否可行
回復

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術交流QQ群281945664

Powered by 單片機教程網

快速回復 返回頂部 返回列表