Skip to content
Snippets Groups Projects
Select Git revision
  • e84f28e9a88f238f1b053c5611a7a6b4243f519f
  • master default protected
2 results

README.md

Blame
  • planner.ino 6.78 KiB
    
    void planner()
    {  
      
      for (int a=0;a<max_ax;a++)
      {
        if (speed[a]==null_speed) dir[a]=d_stop;
        if (speed[a]>null_speed) dir[a]=d_up;
        if (speed[a]<null_speed) dir[a]=d_down;  
      }
      
    
      
      for (int a=0;a<max_ax;a++)
      {
        testpos(a);
      }
      
      running=false;
      for (int a=0;a<max_ax;a++)
      {
        if (!sak[a]) running=true;
      }
    
      if (running!=lastrunning)
      {
    
    
    
        
        if (running) Serial.println("running");
        else 
        {
          Serial.println("stop");
    
          if (issequence)
          {  
            seq++;
            if (targets[0][seq]!=maxpos[0]+1)
            {
              delay(1000);
              target[0]=targets[0][seq];
              goposax(0);
            }
        else 
        {
         if (repeat)
          {
           seq=0;
           if (targets[0][seq]!=maxpos[0]+1)
            {
            delay(1000);
            target[0]=targets[0][seq];
            goposax(0);
            }
         
          }
       else issequence=false;   
        }
      }
      }
      lastrunning=running;
    }
    
    }
    
    
    
    
    //set start values for certain ax