It was written in version 1.6.3
here is the latest .
what version was it written in?
i will try older version tomorrow. thanksScreenshot (14).jpg
It was written in version 1.6.3
change LCD.init to LCD.begin just make sure you have the Arduino-LiquidCrystal-I2C-library-master file set up how it say`s in the read me and keypad in the same place
Last edited by daniellyall; 07-14-2015 at 06:08 AM.
<img src="https://ivxo1q-dm2305.files.1drv.com/y4mENMmTr_Cabc7pR0FUdB6gtbADq2JbuG4_rGy0eBQvLJx19pTi6TqMUIJN0xgOyDIc0gWoxYhS38HpbSTFGdfaK-o42IOU6jczrhDpfpCOTNGL1X6hvZCbgj0y35gqmq1YGTrWwShYGV-C7lXA2esy0Pi_WfnBSyroDLSGXwce4uSr1U7op7srdi78rispHCa_K4aFlTlJPVkkNWMfgh_Tg?width=60&height=60&cropmode=none" width="60" height="60" />
Being Disabled is OK CNC is For fuN
it compiles using 1.6.3 and uploads but nothing on lcd
try uploading a lcd.12c example and see what happens
<img src="https://ivxo1q-dm2305.files.1drv.com/y4mENMmTr_Cabc7pR0FUdB6gtbADq2JbuG4_rGy0eBQvLJx19pTi6TqMUIJN0xgOyDIc0gWoxYhS38HpbSTFGdfaK-o42IOU6jczrhDpfpCOTNGL1X6hvZCbgj0y35gqmq1YGTrWwShYGV-C7lXA2esy0Pi_WfnBSyroDLSGXwce4uSr1U7op7srdi78rispHCa_K4aFlTlJPVkkNWMfgh_Tg?width=60&height=60&cropmode=none" width="60" height="60" />
Being Disabled is OK CNC is For fuN
Tonight I will download 1.6.5 version, run the sketch and report back. Bob
it compiles on 1.65
<img src="https://ivxo1q-dm2305.files.1drv.com/y4mENMmTr_Cabc7pR0FUdB6gtbADq2JbuG4_rGy0eBQvLJx19pTi6TqMUIJN0xgOyDIc0gWoxYhS38HpbSTFGdfaK-o42IOU6jczrhDpfpCOTNGL1X6hvZCbgj0y35gqmq1YGTrWwShYGV-C7lXA2esy0Pi_WfnBSyroDLSGXwce4uSr1U7op7srdi78rispHCa_K4aFlTlJPVkkNWMfgh_Tg?width=60&height=60&cropmode=none" width="60" height="60" />
Being Disabled is OK CNC is For fuN
I downloaded 1.6.5 and the sketch compiled ok with no errors. Bob
there was no example lcd.i2c in folder. i ran hello world it ran ok, other examples with cursor blink no blink ok. just for the hell of it i plugged in 16x2 display key shield it is running on that display . thanks headed out this weekend to brother inlaw. He knows code for arduino. he is going to help figure it out. i will report back with the findings. thanks for all the help!!! I really appreciate
it.
put the files in this zip into C:\Users\your use file name\Documents\Arduino\libraries
<img src="https://ivxo1q-dm2305.files.1drv.com/y4mENMmTr_Cabc7pR0FUdB6gtbADq2JbuG4_rGy0eBQvLJx19pTi6TqMUIJN0xgOyDIc0gWoxYhS38HpbSTFGdfaK-o42IOU6jczrhDpfpCOTNGL1X6hvZCbgj0y35gqmq1YGTrWwShYGV-C7lXA2esy0Pi_WfnBSyroDLSGXwce4uSr1U7op7srdi78rispHCa_K4aFlTlJPVkkNWMfgh_Tg?width=60&height=60&cropmode=none" width="60" height="60" />
Being Disabled is OK CNC is For fuN
i worked on it today with brother in law . replaced init with begin and moved folders around to the right place it is up and running !!! THANK YOU
**UPDATE**
Almost 2 years ago I started this thread and I thought that I should probably share the final version of my rotary table controller. Here are some pictures of my completed enclosure. I added a divisions mode and setup the interface to allow the user to select between divisions or to enter the degrees directly a while back but others have added even more. To do it over again I would make a metal case for the controller because the 3D printed one is too flimsy to live in a shop for very long.
File_000.jpgFile_001.jpg
Last edited by sloucks; 12-03-2015 at 12:28 AM.
Updated my original sketch to work with the Libraries available for download in this thread.
HTML Code:/* A program for controlling a single stepper motor driving a rotary table. Uses a 4x4 matrix keypad for entry of degrees and direction or number of divisions to move the table. Serial I2C display, Pololu stepper driver. */ #include <Wire.h> #include <LiquidCrystal_I2C.h> #include <Keypad.h> const byte ROWS = 4; const byte COLS = 4; char keys[ROWS][COLS] = { {'1','2','3','A'}, {'4','5','6','B'}, {'7','8','9','C'}, {'.','0','#','D'} }; byte rowPINS[ROWS] = {11,10,9,8}; byte colPINS[COLS] = {7,6,5,4}; Keypad kpd = Keypad(makeKeymap(keys),rowPINS,colPINS, ROWS, COLS); LiquidCrystal_I2C lcd(0x27,20,4); // set the LCD address to 0x20 for a 16 chars and 2 line display //setup vars const int stp = 12; //connect pin 12 to step const int dir = 13; // connect pin 13 to dir const int StepsPerRotation = 400; //Set Steps per rotation of stepper const int TableRatio = 72; //ratio of rotary table const int Multiplier = (StepsPerRotation * TableRatio)/360; const int stepdelay = 1; float Degrees = 0; //Degrees from Serial input float ToMove = 0; //Steps to move float Divisions; float current = 0; int Mode = 0; void setup() { lcd.begin(); // initialize the lcd pinMode(stp, OUTPUT); pinMode(dir, OUTPUT); // Print welcome message to the LCD. lcd.backlight(); lcd.print("Rotary Table Control"); lcd.setCursor(0,2); lcd.print(" CrankyTechGuy CNC"); lcd.setCursor(0,3); lcd.print(" Copyright 2014"); delay(2000); lcd.begin(); Mode = GetMode(); } void software_Reset() // Restarts program from beginning but does not reset the peripherals and registers { asm volatile (" jmp 0"); } void rotation(float tm, int d) { if(d == 0) { digitalWrite(dir, LOW); } else { digitalWrite(dir, HIGH); } for(int i = 0; i < tm; i++) { digitalWrite(stp, HIGH); delay(stepdelay); digitalWrite(stp, LOW); delay(stepdelay); } } float GetNumber() { float num = 0.00; float decimal = 0.00; float decnum = 0.00; int counter = 0; char key = kpd.getKey(); lcd.setCursor(0,0);lcd.print("Enter degrees then");lcd.setCursor(0,1);lcd.print(" press [#]."); lcd.setCursor(0,3);lcd.print("Reset [D]"); lcd.setCursor(8,2); bool decOffset = false; while(key != '#') { switch (key) { case NO_KEY: break; case '.': if(!decOffset) { decOffset = true; } lcd.print(key); break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if(!decOffset) { num = num * 10 + (key - '0'); lcd.print(key); } else if((decOffset) && (counter <= 1)) { num = num * 10 + (key - '0'); lcd.print(key); counter++; } break; case 'D': software_Reset(); break; } decnum = num / pow(10, counter); key = kpd.getKey(); } return decnum; } float GetDivisions() { float num = 0.00; char key = kpd.getKey(); lcd.clear(); lcd.setCursor(0,0);lcd.print("Enter Divisions then");lcd.setCursor(0,1);lcd.print(" press [#]."); lcd.setCursor(0,3);lcd.print("Reset [D]"); lcd.setCursor(8,2); while(key != '#') { switch (key) { case NO_KEY: break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': num = num * 10 + (key - '0'); lcd.print(key); break; case 'D': software_Reset(); break; } key = kpd.getKey(); // num = 360/num; } return num; } int GetMode() { int mode = 0; lcd.setCursor(0,1);lcd.print("Select Op Mode"); lcd.setCursor(0,3); lcd.print(" DIV[A] DEG[B]"); while(mode == 0) { char key = kpd.getKey(); if(key == 'A') { mode = 1; } else if(key == 'B') { mode = 2; } } lcd.clear(); return mode; } void loop() { if(Mode == 1) { Divisions = GetDivisions(); Degrees = (360/Divisions); } if(Mode == 2) { Degrees = GetNumber(); } lcd.clear(); lcd.setCursor(0,3); lcd.print("FWD[A] REV[B] CAN[C]"); char key = kpd.getKey(); while(key != 'C') { lcd.setCursor(0,0);lcd.print("POS:");lcd.print(current);lcd.setCursor(0,1);lcd.print("DPM:");lcd.print(Degrees); key = kpd.getKey(); if(key == 'A') { if(current >= 360) { current = (current + Degrees)-360; } else { current = current + Degrees; } ToMove = Degrees*Multiplier; lcd.setCursor(0,2); lcd.print(" Moving "); rotation(ToMove,2); lcd.setCursor(0,2);lcd.print(" "); lcd.setCursor(4,0);lcd.print(" "); } if(key == 'B') { if(current <= 0) { current = 360+(current - Degrees); } else { current = current - Degrees; } ToMove = Degrees*Multiplier; lcd.setCursor(0,2); lcd.print(" Moving "); rotation(ToMove,0); lcd.setCursor(0,2);lcd.print(" "); lcd.setCursor(4,0);lcd.print(" "); } } lcd.clear(); }
that was close I was just about to post the mistake
<img src="https://ivxo1q-dm2305.files.1drv.com/y4mENMmTr_Cabc7pR0FUdB6gtbADq2JbuG4_rGy0eBQvLJx19pTi6TqMUIJN0xgOyDIc0gWoxYhS38HpbSTFGdfaK-o42IOU6jczrhDpfpCOTNGL1X6hvZCbgj0y35gqmq1YGTrWwShYGV-C7lXA2esy0Pi_WfnBSyroDLSGXwce4uSr1U7op7srdi78rispHCa_K4aFlTlJPVkkNWMfgh_Tg?width=60&height=60&cropmode=none" width="60" height="60" />
Being Disabled is OK CNC is For fuN
What is wrong ......
Arduino: 1.6.5 (Windows 7), Board:"Arduino/Genuino Uno"
rotary.ino: In function 'void setup()':
rotary:45: error: no matching function for call to 'LiquidCrystal_I2C::begin()'
rotary.ino:45:13: note: candidate is:
In file included from rotary.ino:10:0:
C:\Program Files (x86)\Arduino\libraries\LiquidCrystal_I2C/LiquidCrystal_I2C.h:59:8: note: void LiquidCrystal_I2C::begin(uint8_t, uint8_t, uint8_t)
void begin(uint8_t cols, uint8_t rows, uint8_t charsize = LCD_5x8DOTS );
^
C:\Program Files (x86)\Arduino\libraries\LiquidCrystal_I2C/LiquidCrystal_I2C.h:59:8: note: candidate expects 3 arguments, 0 provided
rotary:57: error: no matching function for call to 'LiquidCrystal_I2C::begin()'
rotary.ino:57:13: note: candidate is:
In file included from rotary.ino:10:0:
C:\Program Files (x86)\Arduino\libraries\LiquidCrystal_I2C/LiquidCrystal_I2C.h:59:8: note: void LiquidCrystal_I2C::begin(uint8_t, uint8_t, uint8_t)
void begin(uint8_t cols, uint8_t rows, uint8_t charsize = LCD_5x8DOTS );
^
C:\Program Files (x86)\Arduino\libraries\LiquidCrystal_I2C/LiquidCrystal_I2C.h:59:8: note: candidate expects 3 arguments, 0 provided
no matching function for call to 'LiquidCrystal_I2C::begin()'
you don't have the 12c library it's in the zip in post 50 all 3 required libraries are there
<img src="https://ivxo1q-dm2305.files.1drv.com/y4mENMmTr_Cabc7pR0FUdB6gtbADq2JbuG4_rGy0eBQvLJx19pTi6TqMUIJN0xgOyDIc0gWoxYhS38HpbSTFGdfaK-o42IOU6jczrhDpfpCOTNGL1X6hvZCbgj0y35gqmq1YGTrWwShYGV-C7lXA2esy0Pi_WfnBSyroDLSGXwce4uSr1U7op7srdi78rispHCa_K4aFlTlJPVkkNWMfgh_Tg?width=60&height=60&cropmode=none" width="60" height="60" />
Being Disabled is OK CNC is For fuN
Thanks... It is working
thanks for documenting your build its awesome and Im going to have a go at making one.
Thanks for sharing. I made one too a couple years ago. Haven't used it in a while so this is inspiring me to dig it out and remember what I did. I used a 2x16 LCD and programmed it for number of steps (holes or gears) and angle step size, and free run/jog either direction with speed setting.
Hi, can I ask what pin numbers do the LCD screen connect to?, I think Im Ok with the rest of project, Just ordered the LCD screen and keypad. Ive got an arduino uno