コード例 #1
0
static void lcd_menu_change_material_remove()
{
    run_history = true;
    lcd_info_screen(lcd_menu_material_main, cancelMaterialInsert);
    lcd_lib_draw_stringP(3, 20, PSTR("Reversing material"));

    if (!blocks_queued())
        {
            lcd_lib_beep();
            led_glow_dir = led_glow = 0;
            currentMenu = lcd_menu_change_material_remove_wait_user;
            SELECT_MAIN_MENU_ITEM(0);
            //Disable the extruder motor so you can pull out the remaining filament.
            disable_e0();
            disable_e1();
            disable_e2();
        }

    long pos = -st_get_position(E_AXIS);
    long targetPos = lround(FILAMENT_REVERSAL_LENGTH*axis_steps_per_unit[E_AXIS]);
    uint8_t progress = (pos * 125 / targetPos);
    lcd_progressbar(progress);
    lcd_lib_led_color(48,48,255);
    lcd_lib_update_screen();
}
コード例 #2
0
static void lcd_menu_change_material_insert()
{
    LED_GLOW();
    run_history = true;
    lcd_question_screen(lcd_menu_change_material_select_material, materialInsertReady, PSTR("READY"), lcd_menu_main, cancelMaterialInsert, PSTR("CANCEL"));
    lcd_lib_draw_string_centerP(20, PSTR("Wait till material"));
    lcd_lib_draw_string_centerP(30, PSTR("comes out the nozzle"));

    if (movesplanned() < 2)
        {
            current_position[E_AXIS] += 0.5;
            plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], FILAMENT_INSERT_EXTRUDE_SPEED, active_extruder);
        }
    lcd_lib_led_color(48,48,255);
    lcd_lib_update_screen();
}
コード例 #3
0
static void lcd_menu_change_material_insert_forward()
{
    run_history = true;
    lcd_info_screen(lcd_menu_main, cancelMaterialInsert);
    lcd_lib_draw_stringP(3, 20, PSTR("Forwarding material"));

    if (!blocks_queued())
        {
            lcd_lib_beep();
            led_glow_dir = led_glow = 0;

            digipot_current(2, motor_current_setting[2]*2/3);//Set the E motor power lower to we skip instead of grind.
            currentMenu = lcd_menu_change_material_insert;
            SELECT_MAIN_MENU_ITEM(0);
        }

    long pos = st_get_position(E_AXIS);
    long targetPos = lround(FILAMENT_FORWARD_LENGTH*axis_steps_per_unit[E_AXIS]);
    uint8_t progress = (pos * 125 / targetPos);
    lcd_progressbar(progress);
    lcd_lib_led_color(48,48,255);
    lcd_lib_update_screen();
}
コード例 #4
0
/** LCD API **/
void lcd_init()
{
    lcd_implementation_init();

#ifdef NEWPANEL
    pinMode(BTN_EN1,INPUT);
    pinMode(BTN_EN2,INPUT);
    WRITE(BTN_EN1,HIGH);
    WRITE(BTN_EN2,HIGH);
  #if BTN_ENC > 0
    pinMode(BTN_ENC,INPUT);
    WRITE(BTN_ENC,HIGH);
  #endif
  #ifdef REPRAPWORLD_KEYPAD
    pinMode(SHIFT_CLK,OUTPUT);
    pinMode(SHIFT_LD,OUTPUT);
    pinMode(SHIFT_OUT,INPUT);
    WRITE(SHIFT_OUT,HIGH);
    WRITE(SHIFT_LD,HIGH);
  #endif
#else  // Not NEWPANEL
  #ifdef SR_LCD_2W_NL // Non latching 2 wire shift register
     pinMode (SR_DATA_PIN, OUTPUT);
     pinMode (SR_CLK_PIN, OUTPUT);
  #elif defined(SHIFT_CLK) 
     pinMode(SHIFT_CLK,OUTPUT);
     pinMode(SHIFT_LD,OUTPUT);
     pinMode(SHIFT_EN,OUTPUT);
     pinMode(SHIFT_OUT,INPUT);
     WRITE(SHIFT_OUT,HIGH);
     WRITE(SHIFT_LD,HIGH);
     WRITE(SHIFT_EN,LOW);
  #else
     #ifdef ULTIPANEL
     #error ULTIPANEL requires an encoder
     #endif
  #endif // SR_LCD_2W_NL
#endif//!NEWPANEL

#if defined (SDSUPPORT) && defined(SDCARDDETECT) && (SDCARDDETECT > 0)
    pinMode(SDCARDDETECT,INPUT);
    WRITE(SDCARDDETECT, HIGH);
    lcd_oldcardstatus = IS_SD_INSERTED;
#endif//(SDCARDDETECT > 0)
#ifdef LCD_HAS_SLOW_BUTTONS
    slow_buttons = 0;
#endif
    lcd_buttons_update();
#ifdef ULTIPANEL
    encoderDiff = 0;
#endif
#ifdef MIREGLI
    //ClockFreq = (F_CPU) / (16 + 2*TWBR * 4^TWPS)
    //TWBR = ((F_CPU / ClockFreq) - 16)/2*4^TWPS
    TWBR = ((F_CPU / I2C_FREQ) - 16)/2*1;
    TWSR = 0x00;
//lcd_lib_led_color(48,48,60); //Blue
//lcd_lib_led_color(10,60,10); //Green
lcd_lib_led_color(51,153,255); //SeeMeCNC Blue LED

  i2c_led_write(0, 0x80);//MODE1
  i2c_led_write(1, 0x1C);//MODE2
  i2c_led_write(2, led_r);//PWM0
  i2c_led_write(3, led_g);//PWM1
  i2c_led_write(4, led_b);//PWM2
  i2c_led_write(5, 0x00);//PWM3
  i2c_led_write(6, 0xFF);//GRPPWM
  i2c_led_write(7, 0x00);//GRPFREQ
  i2c_led_write(8, 0xAA);//LEDOUT
#endif
}