void setup() { Serial.begin(9600); Serial.println("<Ardunio & Display is ready>");}
void loop() { while (c == 0){ MappingChars(); LoadingDegree(); Serial.print("The value of StepBuff is"); Serial.println(StepBuff); Serial.print("The value of Step00 is"); Serial.println(Step00); Serial.print("The value of Step01 is"); Serial.println(Step01); c++;}}
if (ReceivedChars[i] = 'b'){StepBuff[i] = 3;i++;StepBuff[i] = 0;i--;}}}
void LoadingDegree(){
for(int k=0; k<4; k++){ if (StepBuff[k] == 0 && k == 0){Step00 = StepBuff[k];}
if (StepBuff[k] == 4 && k == 0){Step00 = StepBuff[k];}}}
複製代碼
作者: asservir 時間: 2015-3-26 19:59
CODE變得好亂..我再貼一次
char Step00;
char Step01;
char StepBuff[10];
const byte cmmd = 32;
char ReceivedChars[cmmd] = {'a', 'b'};
int c =0;
void setup()
{
Serial.begin(9600);
Serial.println("<Ardunio & Display is ready>");
}
void loop() //
{
while (c == 0)
{
MappingChars();
LoadingDegree();
Serial.print("The value of StepBuff is"); //
Serial.println(StepBuff);
Serial.print("The value of Step00 is");
Serial.println(Step00);
Serial.print("The value of Step01 is");
Serial.println(Step01);
c++;
}
}