Home > Back-end >  Keil4 error, TEXT1. C (23) : error C216: subscript on non - array or too many dimensions
Keil4 error, TEXT1. C (23) : error C216: subscript on non - array or too many dimensions

Time:09-18

This is my program
# include & lt; stdio.h>
#include
Sbit p1=P2 ^ 7;//define digital tube 10 selected
Sbit p2=p2 ^ 6;//define digital tube bits selected
Sbit p3=P2 ^ 5;//define digital tube small digital choose
Sbit p4=P2 ^ 4;//define digital tube V who choose
Sbit dp=P0 ^ 7;//define digital tube decimal place choose void init_timer ()
{int TMOD TH0, TL0, EA, ET0, TR0; TMOD=0 x01; TH0=(65536-3500)/256; TL0=(65536-3500) % 256; EA=1; ET0=1; TR0=1; }
Void the display (void)
{int (p1, p2, p3, p4.
Long int P0, bb, SGN; P1=0; The p2=0; P3=0; P4=0;//choose shut the if (bb/100% 10==0)//judgment voltage 10 is equal to 0 P0=SGN [10].//so, don't show, send code else P0=SGN bb/100% 10;//if not, it showed that send segment code p1=1; The p2=0; P3=0; P4=0;//person selected DelayMs (3);//show delay p1=0; The p2=0; P3=0; P4=0;//person choose close P0=SegCode bb/10% 10;//send bits segment code dp=0;//light point p1=0; The p2=1; P3=0; P4=0;//person selected DelayMs (3);//show delay p1=0; The p2=0; P3=0; P4=0;//person choose close P0=SegCode [10] bb %;//send small digital segment code p1=0; The p2=0; P3=1; P4=0;//person selected DelayMs (3);//show delay p1=0; The p2=0; P3=0; P4=0;//person choose close P0=SegCode [11].//send V field p1=0; The p2=0; P3=0; P4=1;//person selected DelayMs (3);//show delay p1=0; The p2=0 p3=0; P4=0;//person choose close
}
Void DA_Conver (unsigned int DAValue) {unsigned char (I); DAValue & lt; <=6; CS=0; CLK=0; for(i=0; I & lt; 12. I++) {DIN=(bit) (DAValue & amp; 0 x8000); CLK=1; DAValue & lt; <=1; CLK=0; CS=1}; CLK=0; }
Void keyscan1 scan ()//pressing the reset button
{if (an1==0)//button press {aa=0;//DA variable assignment of 0 bb=0; (an1} while==0);//exit

CodePudding user response:

I think lz should first find the entry-level materials, first to learn
Subject problem, should be the display function SGN variables, it is a common long, was as array using P0=SGN [0]
In addition, the effect of variable scope is not clear, bb is the display of the local variable, keyscan1 see bb, how can we clear 0 to bb?
And uninitialized variable is used, the if (bb/100% 10==0) here bb didn't assign values, the calculation results can correct?
Unless the bb is a global variable

CodePudding user response:

reference 1st floor qybao response:
I think lz should first find the entry-level materials, first to learn
Subject problem, should be the display function SGN variables, it is a common long, was as array using P0=SGN [0]
In addition, the effect of variable scope is not clear, bb is the display of the local variable, keyscan1 see bb, how can we clear 0 to bb?
And uninitialized variable is used, the if (bb/100% 10==0) here bb didn't assign values, the calculation results can correct?
Unless the bb is a global variable
thank you, I am a freshman, to do class set, couldn't really do it, what should I change?
  • Related