Home > other >  How to write key program?
How to write key program?

Time:10-07


As shown in figure, add four buttons, respectively, plus, minus, determine the function, how to write a program to implement S, KP, KI parameter values change??

CodePudding user response:

Is independent keyboard directly write judgment, there is a problem the code to see see! For example:
 
Sbit QiTin=P3 ^ 0;//stop button
Void main ()
{
ZhongDuanSheZhi ();
While (1)
{
XianShi ();
if(! QiTin)
{
//XianShi (/* skillfully by 8 digital display shake */elimination);
Unsigned char Yan_Shi=Js;
If (TR0==0) {TR0=k=1; }//reset interrupt
While (Js)==Yan_Shi XianShi ();//interrupt shaking,
if(! QiTin) if (! K) TR0=k; The else k=0;//close the interrupt, after shaking, clear mark (use double judgment! K | |! TR0 & amp; & K)
while(! QiTin) XianShi (/* press during display */);
}
}
}

CodePudding user response:

reference 1/f, the wise know already should good karma response:
is an independent keyboard directly write judgment, there is a problem the code to see see! For example:
 
Sbit QiTin=P3 ^ 0;//stop button
Void main ()
{
ZhongDuanSheZhi ();
While (1)
{
XianShi ();
if(! QiTin)
{
//XianShi (/* skillfully by 8 digital display shake */elimination);
Unsigned char Yan_Shi=Js;
If (TR0==0) {TR0=k=1; }//reset interrupt
While (Js)==Yan_Shi XianShi ();//interrupt shaking,
if(! QiTin) if (! K) TR0=k; The else k=0;//close the interrupt, after shaking, clear mark (use double judgment! K | |! TR0 & amp; & K)
while(! QiTin) XianShi (/* press during display */);
}
}
}

This pinyin annotation is not afraid of being beaten???????????

CodePudding user response:

reference 1/f, the wise know already should good karma response:
is an independent keyboard directly write judgment, there is a problem the code to see see! For example:
 
Sbit QiTin=P3 ^ 0;//stop button
Void main ()
{
ZhongDuanSheZhi ();
While (1)
{
XianShi ();
if(! QiTin)
{
//XianShi (/* skillfully by 8 digital display shake */elimination);
Unsigned char Yan_Shi=Js;
If (TR0==0) {TR0=k=1; }//reset interrupt
While (Js)==Yan_Shi XianShi ();//interrupt shaking,
if(! QiTin) if (! K) TR0=k; The else k=0;//close the interrupt, after shaking, clear mark (use double judgment! K | |! TR0 & amp; & K)
while(! QiTin) XianShi (/* press during display */);
}
}
}
said look not to understand, ah ha ha ha

CodePudding user response:

Is an chestnuts, judgement is independent buttons, look not to understand the code is very normal, because it is other project extract has nothing to do with you, actually a little finishing note can understand:
 

Sbit QiTin=P3 ^ 0;//stop button
Void main ()
{
While (1)
{
if(! QiTin)//decision to press the button
{
Unsigned char Yan_Shi=255;
While (- Yan_Shi);//shaking,
if(! QiTin)//determine whether is pressed again
{what execution? }
while(! QiTin);//wait for the button is released
}
}
}

Usually it buttons

CodePudding user response:

If want to copy the code have a plenty of places to copy, why to ask?
  • Related