標題: 主程序count和中斷程序sedcount是什么關(guān)系?能不能共用變量? [打印本頁]

作者: abelchrisnic    時間: 2017-6-16 16:55
標題: 主程序count和中斷程序sedcount是什么關(guān)系?能不能共用變量?
void loop()
{
  if(state!=last)
  {
   count++;
  if(count=9)
  {
    inter();
  }
}

void inter()
{
  if(LEDstate!=LEDlast)
  {
   sedcount++;
  if(sedcount=10)
  {
   display();
    }
}

想問各位大神,count和2號count之間是什么關(guān)系最終才會觸發(fā)display? 2個if里面的元素其實都是初始從0開始計算的,2號IF里面的變量能不能和1號IF里面的變量共用





歡迎光臨 (http://www.torrancerestoration.com/bbs/) Powered by Discuz! X3.1