Beispiel #1
0
void lcd_set_home_offsets()
{
    for(int8_t i=0; i < NUM_AXIS; i++) {
      if (i != E_AXIS) {
        add_homing[i] -= current_position[i];
        current_position[i] = 0.0;
      }
    }
    plan_set_position(0.0, 0.0, 0.0, current_position[E_AXIS]);

    // Audio feedback
    enquecommand_P(PSTR("M300 S659 P200"));
    enquecommand_P(PSTR("M300 S698 P200"));
    lcd_return_to_status();
}
Beispiel #2
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;
    }
}
Beispiel #3
0
static void lcd_easy_unload()
{
  allow_lengthy_extrude_once = true;
	lcd_extrude(-BOWDEN_LENGTH, LCD_UNLOAD_FEEDRATE/60);
    lcd_return_to_status();
}
Beispiel #4
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();
  
}
Beispiel #5
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();
  
}
Beispiel #6
0
////i2
static void lcd_calibrate_bed()
{
enquecommand_P(PSTR("G21"));//set units to millimeters
if (fil_temp == 200)
{
enquecommand_P(PSTR("M190 S60"));//wait for bed temperature to be reached
enquecommand_P(PSTR("M104 S200"));//set temperature
}
if (fil_temp == 230)	
{
enquecommand_P(PSTR("M190 S80"));//wait for bed temperature to be reached
enquecommand_P(PSTR("M104 S230"));//set temperature
}
enquecommand_P(PSTR("G28 X0 Y0"));//Home x and y axis
enquecommand_P(PSTR("G1 X20 Y20 F4000"));//Center extruder above bed
enquecommand_P(PSTR("G28 Z0"));
enquecommand_P(PSTR("G1 Z5 F5000"));//lift nozzle
if (fil_temp == 200)
{
enquecommand_P(PSTR("M109 S200"));//set temperature
}
if (fil_temp == 230)	
{
enquecommand_P(PSTR("M109 S230"));//set temperature
}
enquecommand_P(PSTR("G90"));//use absolute coordinates
enquecommand_P(PSTR("G92 E0"));
enquecommand_P(PSTR("M82"));//use absolute distances for extrusion
//if (fil_temp == 200)
//{
//enquecommand_P(PSTR("M106 S255"));
//}
enquecommand_P(PSTR("G1 E-1.00000 F1020.00000"));//
enquecommand_P(PSTR("G92 E0"));//
enquecommand_P(PSTR("G1 Z0.250 F6000.000"));//
enquecommand_P(PSTR("G1 X27.500 Y27.500 F6000.000"));//
enquecommand_P(PSTR("G1 E1.00000 F1020.00000"));//
enquecommand_P(PSTR("G1 X272.290 Y27.500 E10.32102 F1200.000"));//
enquecommand_P(PSTR("G1 X272.464 Y27.536 E10.32778"));//
enquecommand_P(PSTR("G1 X272.500 Y27.710 E10.33455"));//
enquecommand_P(PSTR("G1 X272.500 Y272.290 E19.64757"));//
enquecommand_P(PSTR("G1 X272.464 Y272.464 E19.65433"));//
enquecommand_P(PSTR("G1 X272.290 Y272.500 E19.66110"));//
enquecommand_P(PSTR("G1 X27.710 Y272.500 E28.97412"));//
enquecommand_P(PSTR("G1 X27.536 Y272.464 E28.98089"));//
enquecommand_P(PSTR("G1 X27.500 Y272.290 E28.98765"));//
enquecommand_P(PSTR("G1 X27.500 Y34.710 E38.03413"));//
enquecommand_P(PSTR("G1 X27.536 Y34.536 E38.04089"));//
enquecommand_P(PSTR("G1 X27.710 Y34.500 E38.04766"));//
enquecommand_P(PSTR("G1 X260.459 Y34.500 E46.91018"));//
enquecommand_P(PSTR("G1 E45.91018 F1020.00000"));//
enquecommand_P(PSTR("G92 E0"));//
enquecommand_P(PSTR("G1 Z3 F6000"));//
//if (fil_temp == 200)
//{
//enquecommand_P(PSTR("M107"));
//}
enquecommand_P(PSTR("G28 X0"));//turn off temperature
enquecommand_P(PSTR("M84"));
enquecommand_P(PSTR("G28 X0"));//home X axis
enquecommand_P(PSTR("M84"));//disable motors
enquecommand_P(PSTR("M140 S0"));//turn off heatbed
fil_temp = 0;
lcd_return_to_status();
}
Beispiel #7
0
static void lcd_fc()
{
if (fil_temp == 200)
{
setTargetHotend0(plaPreheatHotendTemp);
}
if (fil_temp == 230)
{
setTargetHotend0(absPreheatHotendTemp);
}
setWatch(); // heater sanity check timer
if (!isHeatingHotend(0)&&(filament_seq == 0))
{
filament_seq = 1;
}
if ((filament_seq == 0)&&(pausa_display == 0))
{
pausa_display = 1;
}
if (filament_seq == 1)
{   
if (st_message == 0)  
    {
	lcdDrawUpdate = 2;  
	lcd_implementation_message0(PSTR("Introducir el nuevo"));
    lcd_implementation_message1(PSTR("filamento y girar el  "));
	lcd_implementation_message2(PSTR("boton hasta que"));
	lcd_implementation_message3(PSTR("salga el filamento"));
	if (encoder_zero == 0)
	{
	encoderPosition = 0;
	encoder_zero = 1;
	}
	}
    if (encoderPosition != 0)
    {
	    move_menu_scale = 1.0;
        current_position[E_AXIS] += float((int)encoderPosition) * move_menu_scale;
        encoderPosition = 0;
		 #ifdef DELTA
        calculate_delta(current_position);
        plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], manual_feedrate[E_AXIS]/60, active_extruder);
        #else
        plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[E_AXIS]/60, active_extruder);
        #endif
        lcdDrawUpdate = 2;
		st_message = 1;
    }
	
    if ((lcdDrawUpdate) && (st_message == 1))
    {
	lcd_implementation_drawedit(PSTR("Extruder"), ftostr31(current_position[E_AXIS]));
    }

}
else
    {
    lcd_implementation_message4(PSTR(" Calentando..."));
    _draw_heater_status(6, 0);
	lcdDrawUpdate = 1;
	u8g.drawBitmapP(9,1,STATUS_SCREENBYTEWIDTH,STATUS_SCREENHEIGHT, (blink % 2) && fanSpeed ? status_screen0_bmp : status_screen1_bmp);
	
	}
	
if ((LCD_CLICKED) || (degTargetHotend(0) == 0)  || (currentMenu == lcd_status_screen))
	{
 	filament_seq = 0;
	st_message = 0;
	pausa_display = 0;
	encoder_zero = 0;
	setTargetHotend0(0);
	lcd_return_to_status();
    }
}
Beispiel #8
0
////i2
static void lcd_calibrate_bed()
{
enquecommand_P(PSTR("G21"));//set units to millimeters
if (fil_temp == 200)
{
enquecommand_P(PSTR("M104 S200"));//set temperature
}
if (fil_temp == 230)	
{
enquecommand_P(PSTR("M190 S100"));//wait for bed temperature to be reached
enquecommand_P(PSTR("M104 S230"));//set temperature
}
enquecommand_P(PSTR("G28 X0 Y0"));//Home x and y axis
enquecommand_P(PSTR("G1 X20 Y20 F4000"));//Center extruder above bed
enquecommand_P(PSTR("G28 Z0"));
enquecommand_P(PSTR("G1 Z5 F5000"));//lift nozzle
if (fil_temp == 200)
{
enquecommand_P(PSTR("M109 S200"));//set temperature
}
if (fil_temp == 230)	
{
enquecommand_P(PSTR("M109 S230"));//set temperature
}
enquecommand_P(PSTR("G90"));//use absolute coordinates
enquecommand_P(PSTR("G92 E0"));
enquecommand_P(PSTR("M82"));//use absolute distances for extrusion
//if (fil_temp == 200)
//{
//enquecommand_P(PSTR("M106 S255"));
//}
enquecommand_P(PSTR("G1 F900.000 E-0.90000"));
enquecommand_P(PSTR("G92 E0"));
enquecommand_P(PSTR("G1 Z0.250 F1002"));
enquecommand_P(PSTR("G1 X9.985 Y9.985 F9000"));
enquecommand_P(PSTR("G1 E0.0000 F297"));
enquecommand_P(PSTR("G92 E0"));
enquecommand_P(PSTR("G1 X140.015 Y9.985 E5.6763 F864"));
enquecommand_P(PSTR("G1 X140.015 Y135.015 E11.1344"));
enquecommand_P(PSTR("G1 X20.210 Y135.015 E16.3643"));
enquecommand_P(PSTR("G1 X20.210 Y134.985 E16.3656"));
enquecommand_P(PSTR("G1 X139.985 Y134.985 E21.5943"));
enquecommand_P(PSTR("G1 X139.985 Y10.015 E27.0497"));
enquecommand_P(PSTR("G1 X10.015 Y10.015 E32.7234"));
enquecommand_P(PSTR("G1 X10.015 Y139.985 E38.3971"));
enquecommand_P(PSTR("G1 X139.790 Y139.985 E44.0623"));
enquecommand_P(PSTR("G1 X139.790 Y140.015 E44.0636"));
enquecommand_P(PSTR("G1 X9.985 Y140.015 E49.7301"));
enquecommand_P(PSTR("G1 X9.985 Y9.985 E55.4064"));
enquecommand_P(PSTR("G92 E0"));
enquecommand_P(PSTR("G1 Z5"));
//if (fil_temp == 200)
//{
//enquecommand_P(PSTR("M107"));
//}
enquecommand_P(PSTR("G28 X0"));//turn off temperature
enquecommand_P(PSTR("M84"));
enquecommand_P(PSTR("G28 X0"));//home X axis
enquecommand_P(PSTR("M84"));//disable motors
//enquecommand_P(PSTR("M140 S0"));//turn off heatbed
fil_temp = 0;
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;
    }
}
void lcd_preheat_bed()
{
	setTargetBed(BED_PREHEAT_TEMP);
	lcd_return_to_status();
	setWatch(); //sanity check
}