Home > other >  Two digital tube display 0-26 Numbers, thank you for your bosses
Two digital tube display 0-26 Numbers, thank you for your bosses

Time:11-28

With the STM32F103, write out the basic framework, just don't know how to set up inside the while

CodePudding user response:

Need to understand that logic, 1, 2 are PB0, PB1 is used to select on the right or the left an 8 a, 8 don't know is high effective and low effective
 the while (1) 
{
for(i=0; i<26. I++)//need to join in the main I
{
GPIO_Write (GPIOB, 0 x01);//on the left side of a first choice, it is assumed that the high effective, actually don't need to write the PB, only need to write PB0, PB1
GPIO_Write (GPIOC, I/10);
GPIO_Write (GPIOB, 0 x02);//to choose the right one
GPIO_Write (GPIOC, I % 10);
/behind/join delay lest refresh fast can't see
}
}

CodePudding user response:

I forgot to say, I want the result is 0 and dynamic display of 26, I wrote another one, but still won't do to please have a look

CodePudding user response:

Post is inserted into the function of the code, you insert the picture didn't copy your reference code, and you say the problem, such as compilation errors, the Build fails, or the end result is not in line with expectations

 
Void delay (void)
{
Unsigned long I;//int length will not overflow
for(i=0; i<700000; I++);
}

Int main ()
{
Unsigned char temp.//temp need to define the
//look at your code digital tube is need look-up table
Unsigned char ch10;//10
Unsigned char ch1;//you
temp=0;
While (1)//suppose to show temp value
{
Char10=disp temp/10;
, char1=disp [10] temp %;
GPIO_Write (GPIOB, 0 x01);//on the left side of a first choice, if left and right sides against the adjustment of the lower choose logical
GPIO_Write (GPIOC, char10);
GPIO_Write (GPIOB, 0 x02);//to choose the right one
GPIO_Write (GPIOC, char1);
delay();
If (temp<26) temp++; The else temp=0;//to decide how temp change
}
}

CodePudding user response:

Two digital tube Shared data Dan "eight" word, one can only choose one output to display the numerical 7 segment code, the two tubes of sweep frequency is greater than 25 hz
  • Related