Can I use a Arduino Mega 2560 board with ramps 1.4
- This topic has 25 replies, 6 voices, and was last updated 5 years, 1 month ago by .
- You must be logged in to reply to this topic.
Shop › Forum › Makelangelo Polargraph Art Robot › Can I use a Arduino Mega 2560 board with ramps 1.4
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]