Can I use a Arduino Mega 2560 board with ramps 1.4

Home Forum Makelangelo Polargraph Art Robot Can I use a Arduino Mega 2560 board with ramps 1.4

  • This topic has 25 replies, 6 voices, and was last updated 2 weeks ago by AvatarIlex.
Viewing 26 post (of 26 total)
  • Author
    Posts
  • #27712
    AvatarIlex
    Participant

    Although in this code there is a //bounding…

    [code]
    // update the menu position
    if ( lcd_turn!=0 && num_menu_items > 1 ) {
    uint8_t originalPosition = menuStack[menuStackDepth].menu_position_sum / LCD_TURN_PER_MENU;
    uint8_t upperBound = num_menu_items * LCD_TURN_PER_MENU;

    // potentially change the menu item
    menuStack[menuStackDepth].menu_position_sum += lcd_turn;
    // bounding
    if(menuStack[menuStackDepth].menu_position_sum < 0) menuStack[menuStackDepth].menu_position_sum=0;
    if(menuStack[menuStackDepth].menu_position_sum >= upperBound) menuStack[menuStackDepth].menu_position_sum = upperBound-1;

    uint8_t menu_position = menuStack[menuStackDepth].menu_position_sum / LCD_TURN_PER_MENU;
    // check for change
    if (originalPosition != menu_position) {
    lcd_dirty=1;
    LCD_clear();
    }

    [/code]

Viewing 26 post (of 26 total)
  • You must be logged in to reply to this topic.