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 */); } } }