The BOB makes a pretty good Arduino shield for an LCD Control Panel with switches, and ribbon cable connections to stepper motor drivers, space for a relay driver, etc.. Video of the build:
For the LCD panel, Install
For the switches, Install
For Motor Drivers (optional hack for attaching PMinMO compatible stepper or other drivers)
BOBLCDPanel.ino
#include <LiquidCrystal.h> // See this page for the BOB Control Panel build // http://www.massmind.org/techref/arduino-bob-panel.htm #define LCD_COLS 16 #define LCD_ROWS 2 //#define MOTORS #define S1_PIN 10 #define S2_PIN 11 #define S3_PIN 12 #define S4_PIN 13 #define X_DIR 6 #define X_STEP 2 #define Y_DIR 7 #define Y_STEP 3 // Shared with LCD RS #define Z_DIR 8 #define Z_STEP 4 #define A_DIR 9 #define A_STEP 5 // Shared with LCD /E // initialize the library with the numbers of the interface pins LiquidCrystal lcd(3, 5, 6, 7, 8, 9); //use this line instead if you patched C4 to JP4 (Z-STEP) instead. //LiquidCrystal lcd(4, 5, 6, 7, 8, 9); int switch_state() { int i=0; if (0==digitalRead(S1_PIN)) i+=1; if (0==digitalRead(S2_PIN)) i+=2; if (0==digitalRead(S3_PIN)) i+=4; if (0==digitalRead(S4_PIN)) i+=8; return i; } void setup() { // setup the switch pins, with pullups pinMode(S1_PIN, INPUT_PULLUP); pinMode(S2_PIN, INPUT_PULLUP); pinMode(S3_PIN, INPUT_PULLUP); pinMode(S4_PIN, INPUT_PULLUP); #ifdef MOTORS // setup the PWM or Step outputs pinMode(X_STEP, OUTPUT); pinMode(Y_STEP, OUTPUT); pinMode(Z_STEP, OUTPUT); pinMode(A_STEP, OUTPUT); // setup the Direction outputs pinMode(X_DIR, OUTPUT); pinMode(Y_DIR, OUTPUT); pinMode(Z_DIR, OUTPUT); pinMode(A_DIR, OUTPUT); // setup the A2 analog pin as an enable output. pinMode(A2, OUTPUT); #endif // setup the LCD's number of columns and rows: lcd.begin(LCD_COLS, LCD_ROWS); } void loop() { // Print a message to the LCD. lcd.setCursor(0, 0); lcd.print("Hello World! "); lcd.setCursor(0, 1); lcd.print("version 1.00 "); int s = switch_state(); if (0 != s) { // switch was pushed lcd.setCursor(13, 1); lcd.print(s); #ifdef MOTORS lcd.setCursor(0, 0); lcd.print("Motor running"); lcd.print(s*(255/15)); digitalWrite(A2,HIGH); //enable the motors. while (0 != s) { s = switch_state(); analogWrite(X_DIR, s*(255/15)); //run the motor on X 0 to 255 } digitalWrite(A2,LOW); //disable the motors. #endif } delay(1000); lcd.setCursor(0, 0); lcd.print(" "); for(int i=0; i<LCD_COLS; i++) { lcd.setCursor(i, 0); //char i of line 0 if ( i>10 ) lcd.print(i / 10); //divide by 10 gives upper digit, //no decimal because int lcd.setCursor(i, 1); //char i of line 1 lcd.print(i % 10); //modulo 10 gives lower digit delay(10); } delay(500); }
file: /Techref/arduino-bob-panel.htm, 4KB, , updated: 2017/3/24 15:41, local time: 2024/10/14 10:20,
98.80.143.34:LOG IN ©2024 PLEASE DON'T RIP! THIS SITE CLOSES OCT 28, 2024 SO LONG AND THANKS FOR ALL THE FISH!
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://techref.massmind.org/techref/arduino-bob-panel.htm"> BOB LCD Control Panel</A> |
Did you find what you needed? |
Welcome to massmind.org! |
Welcome to techref.massmind.org! |
.