Пример #1
0
void lcd_LoadFilament()
{
  
  
  if(degHotend0() > EXTRUDE_MINTEMP){
    
    enquecommand_P(PSTR(LOAD_FILAMENT_0));
  
  enquecommand_P(PSTR(LOAD_FILAMENT_1));
  
  enquecommand_P(PSTR(LOAD_FILAMENT_2));
    
  }else{

      lcd_implementation_clear();
      
      lcd.setCursor(0, 0);
     
      lcd.print(MSG_ERROR);
      
      lcd.setCursor(0, 2);
     
      lcd.print(MSG_PREHEAT_NOZZLE);
      
      
       delay(2000); 
       lcd_implementation_clear();
  }
  
  

  lcd_return_to_status();
}
Пример #2
0
void lcd_loading_filament(){

  
    lcd_implementation_clear();
      
      lcd.setCursor(0, 0);
     
      lcd.print(MSG_LOADING_FILAMENT);
      lcd.setCursor(0, 2);
      lcd.print(MSG_PLEASE_WAIT);

  
  for(int i = 0; i<20; i++){
    
    lcd.setCursor(i, 3);
    lcd.print(".");
    for(int j = 0;j<10 ; j++){
        manage_heater();
    manage_inactivity(true);
        delay(110);
    
    }
    
     
  }

}
Пример #3
0
void lcd_change_success(){

      lcd_implementation_clear();
      
      lcd.setCursor(0, 2);
     
      lcd.print(MSG_CHANGE_SUCCESS);


}
Пример #4
0
void lcd_change_filament(){
  
    lcd_implementation_clear();
      
      lcd.setCursor(0, 1);
     
      lcd.print(MSG_CHANGING_FILAMENT);


}
Пример #5
0
void lcd_update()
{
    static unsigned long timeoutToStatus = 0;
    
    lcd_buttons_update();
    
    #if (SDCARDDETECT > -1)
    if((IS_SD_INSERTED != lcd_oldcardstatus))
    {
        lcdDrawUpdate = 2;
        lcd_oldcardstatus = IS_SD_INSERTED;
        lcd_implementation_init(); // to maybe revive the lcd if static electricty killed it.
        
        if(lcd_oldcardstatus)
        {
            card.initsd();
            LCD_MESSAGEPGM(MSG_SD_INSERTED);
        }
        else
        {
            card.release();
            LCD_MESSAGEPGM(MSG_SD_REMOVED);
        }
    }
    #endif//CARDINSERTED
    
    if (lcd_next_update_millis < millis())
    {
#ifdef ULTIPANEL
        if (encoderDiff)
        {
            lcdDrawUpdate = 1;
            encoderPosition += encoderDiff;
            encoderDiff = 0;
            timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
        }
        if (LCD_CLICKED)
            timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
#endif//ULTIPANEL
        
        (*currentMenu)();
#ifdef ULTIPANEL
        if(timeoutToStatus < millis() && currentMenu != lcd_status_screen)
        {
            lcd_return_to_status();
            lcdDrawUpdate = 2;
        }
#endif//ULTIPANEL
        if (lcdDrawUpdate == 2)
            lcd_implementation_clear();
        if (lcdDrawUpdate)
            lcdDrawUpdate--;
        lcd_next_update_millis = millis() + 100;
    }
}
Пример #6
0
void lcd_wait_interact(){

    lcd_implementation_clear();
      
      lcd.setCursor(0, 1);
     
      lcd.print(MSG_INSERT_FILAMENT);
      lcd.setCursor(0, 2);
      lcd.print(MSG_PRESS);

}
Пример #7
0
void lcd_update()
{
    static unsigned long timeoutToStatus = 0;

    lcd_buttons_update();

    #ifdef LCD_HAS_SLOW_BUTTONS
    buttons |= lcd_implementation_read_slow_buttons(); // buttons which take too long to read in interrupt context
    #endif

    #if (SDCARDDETECT > 0)
    if((IS_SD_INSERTED != lcd_oldcardstatus))
    {
        lcdDrawUpdate = 2;
        lcd_oldcardstatus = IS_SD_INSERTED;
        lcd_implementation_init(); // to maybe revive the lcd if static electricty killed it.

        if(lcd_oldcardstatus)
        {
            card.initsd();
            LCD_MESSAGEPGM(MSG_SD_INSERTED);
        }
        else
        {
            card.release();
            LCD_MESSAGEPGM(MSG_SD_REMOVED);
        }
    }
    #endif//CARDINSERTED

    if (lcd_next_update_millis < millis())
    {
#ifdef ULTIPANEL
		#ifdef REPRAPWORLD_KEYPAD
        	if (REPRAPWORLD_KEYPAD_MOVE_Z_UP) {
        		reprapworld_keypad_move_z_up();
        	}
        	if (REPRAPWORLD_KEYPAD_MOVE_Z_DOWN) {
        		reprapworld_keypad_move_z_down();
        	}
        	if (REPRAPWORLD_KEYPAD_MOVE_X_LEFT) {
        		reprapworld_keypad_move_x_left();
        	}
        	if (REPRAPWORLD_KEYPAD_MOVE_X_RIGHT) {
        		reprapworld_keypad_move_x_right();
        	}
        	if (REPRAPWORLD_KEYPAD_MOVE_Y_DOWN) {
        		reprapworld_keypad_move_y_down();
        	}
        	if (REPRAPWORLD_KEYPAD_MOVE_Y_UP) {
        		reprapworld_keypad_move_y_up();
        	}
        	if (REPRAPWORLD_KEYPAD_MOVE_HOME) {
        		reprapworld_keypad_move_home();
        	}
		#endif
        if (abs(encoderDiff) >= ENCODER_PULSES_PER_STEP)
        {
            lcdDrawUpdate = 1;
            encoderPosition += encoderDiff / ENCODER_PULSES_PER_STEP;
            encoderDiff = 0;
            timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
        }
        if (LCD_CLICKED)
            timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
#endif//ULTIPANEL

#ifdef DOGLCD        // Changes due to different driver architecture of the DOGM display
        blink++;     // Variable for fan animation and alive dot
        u8g.firstPage();
        do
        {
            u8g.setFont(u8g_font_6x10_marlin);
            u8g.setPrintPos(125,0);
            if (blink % 2) u8g.setColorIndex(1); else u8g.setColorIndex(0); // Set color for the alive dot
            u8g.drawPixel(127,63); // draw alive dot
            u8g.setColorIndex(1); // black on white
            (*currentMenu)();
            if (!lcdDrawUpdate)  break; // Terminate display update, when nothing new to draw. This must be done before the last dogm.next()
        } while( u8g.nextPage() );
#else
        (*currentMenu)();
#endif

#ifdef LCD_HAS_STATUS_INDICATORS
        lcd_implementation_update_indicators();
#endif

#ifdef ULTIPANEL
        if(timeoutToStatus < millis() && currentMenu != lcd_status_screen)
        {
            lcd_return_to_status();
            lcdDrawUpdate = 2;
        }
#endif//ULTIPANEL
        if (lcdDrawUpdate == 2)
            lcd_implementation_clear();
        if (lcdDrawUpdate)
            lcdDrawUpdate--;
        lcd_next_update_millis = millis() + 100;
    }
}
Пример #8
0
void lcd_adjust_z(){
  int enc_dif = 0;
  int cursor_pos = 1;
  int fsm = 0;

  
  
  
   lcd_implementation_clear();
      
      lcd.setCursor(0, 0);
     
      lcd.print(MSG_ADJUSTZ);
      
      lcd.setCursor(1, 1);
     
      lcd.print(MSG_YES);
      
      lcd.setCursor(1, 2);
     
      lcd.print(MSG_NO);
      
      lcd.setCursor(0, 1);
     
      lcd.print(">");
      
     
      enc_dif = encoderDiff;
      
      while(fsm == 0){
        
        manage_heater();
          manage_inactivity(true);
          
          if( abs((enc_dif - encoderDiff))>4 ){
            
            if ( (abs(enc_dif-encoderDiff)) > 1 ){
            if (enc_dif > encoderDiff ){
                  cursor_pos --;
              }
              
              if (enc_dif < encoderDiff  ){
                  cursor_pos ++;
              }
              
              if(cursor_pos >2){
              cursor_pos = 2;
            }
            
            if(cursor_pos <1){
              cursor_pos = 1;
            }
            lcd.setCursor(0, 1);
            lcd.print(" ");
            lcd.setCursor(0, 2);
            lcd.print(" ");
            lcd.setCursor(0, cursor_pos);
            lcd.print(">");
              enc_dif = encoderDiff;
              delay(100);
            }
            
          }
          

          if(lcd_clicked()){
            fsm = cursor_pos;
            if(fsm == 1){
                EEPROM_read_B(4093,&babystepMem[0]);
                EEPROM_read_B(4091,&babystepMem[1]);
                EEPROM_read_B(4089,&babystepMem[2]);
                babystepsTodo[Z_AXIS] = babystepMem[2];
            }else{
                babystepMem[0] = 0;
                babystepMem[1] = 0;
                babystepMem[2] = 0;

                EEPROM_save_B(4093,&babystepMem[0]);
                EEPROM_save_B(4091,&babystepMem[1]);
                EEPROM_save_B(4089,&babystepMem[2]);
            }
            delay(500);
              
          }
          
          
          
        };
      
      
       lcd_implementation_clear();
  lcd_return_to_status();
  
}
Пример #9
0
void lcd_alright(){
  int enc_dif = 0;
  int cursor_pos = 1;

  
  
  
   lcd_implementation_clear();
      
      lcd.setCursor(0, 0);
     
      lcd.print(MSG_CORRECTLY);
      
      lcd.setCursor(1, 1);
     
      lcd.print(MSG_YES);
      
      lcd.setCursor(1, 2);
     
      lcd.print(MSG_NOT_LOADED);
      
      
      lcd.setCursor(1, 3);
      lcd.print(MSG_NOT_COLOR);
      
      
       lcd.setCursor(0, 1);
     
      lcd.print(">");
      
     
      enc_dif = encoderDiff;
      
      while(lcd_change_fil_state == 0){
        
        manage_heater();
          manage_inactivity(true);
          
          if( abs((enc_dif - encoderDiff))>4 ){
            
            if ( (abs(enc_dif-encoderDiff)) > 1 ){
            if (enc_dif > encoderDiff ){
                  cursor_pos --;
              }
              
              if (enc_dif < encoderDiff  ){
                  cursor_pos ++;
              }
              
              if(cursor_pos >3){
              cursor_pos = 3;
            }
            
            if(cursor_pos <1){
              cursor_pos = 1;
            }
            lcd.setCursor(0, 1);
            lcd.print(" ");
            lcd.setCursor(0, 2);
            lcd.print(" ");
            lcd.setCursor(0, 3);
            lcd.print(" ");
            lcd.setCursor(0, cursor_pos);
            lcd.print(">");
              enc_dif = encoderDiff;
              delay(100);
            }
            
          }
          

          if(lcd_clicked()){
            
            lcd_change_fil_state = cursor_pos;
            delay(500);
              
          }
          
          
          
        };
      
      
       lcd_implementation_clear();
  lcd_return_to_status();
  
}
void lcd_update()
{
    static unsigned long timeoutToStatus = 0;
    
    lcd_buttons_update();
    
    #if (SDCARDDETECT > -1)
    if((IS_SD_INSERTED != lcd_oldcardstatus))
    {
        lcdDrawUpdate = 2;
        lcd_oldcardstatus = IS_SD_INSERTED;
        lcd_implementation_init(); // to maybe revive the lcd if static electricty killed it.
        
        if(lcd_oldcardstatus)
        {
            card.initsd();
            LCD_MESSAGEPGM(MSG_SD_INSERTED);
        }
        else
        {
            card.release();
            LCD_MESSAGEPGM(MSG_SD_REMOVED);
        }
    }
    #endif//CARDINSERTED
    
    if (lcd_next_update_millis < millis())
    {
#ifdef ULTIPANEL
        if (encoderDiff)
        {
            lcdDrawUpdate = 1;
            encoderPosition += encoderDiff;
            encoderDiff = 0;
            timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
        }
        if (LCD_CLICKED)
            timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
#endif//ULTIPANEL

#ifdef DOGLCD        // Changes due to different driver architecture of the DOGM display
		blink++;	   // Variable for fan animation and alive dot
		u8g.firstPage();
		do {
				u8g.setFont(u8g_font_6x10_marlin);
				u8g.setPrintPos(125,0);
				if (blink % 2) u8g.setColorIndex(1); else u8g.setColorIndex(0); // Set color for the alive dot
				u8g.drawPixel(127,63);	// draw alive dot
				u8g.setColorIndex(1);	// black on white
				(*currentMenu)();
				if (!lcdDrawUpdate)  break; // Terminate display update, when nothing new to draw. This must be done before the last dogm.next()
		   } while( u8g.nextPage() );
#else        
        (*currentMenu)();
#endif

#ifdef ULTIPANEL
        if(timeoutToStatus < millis() && currentMenu != lcd_status_screen)
        {
            lcd_return_to_status();
            lcdDrawUpdate = 2;
        }
#endif//ULTIPANEL
        if (lcdDrawUpdate == 2)
            lcd_implementation_clear();
        if (lcdDrawUpdate)
            lcdDrawUpdate--;
        lcd_next_update_millis = millis() + 100;
    }
}