Arduino control for a 3” rotary table

Home Model Engine Machinist Forum

Help Support Home Model Engine Machinist Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
Hi Bob,
Done as requested....all libraries are installed and controller plugged into USB...no Steeper attached.
 
On to the display.
You said “I have a screen with two O's and nothing else” so it is not completely dead. First make sure that the jumper is on the 2 pins on the small board on the back of the display. If it’s not you have no back light and the display will appear blank.
Again we don’t have to change any of the wiring.
I like this utility for checking the address on I2C devices and so far it’s worked on everything I’ve used it on. Download “I2C_Scanner.zip”, unzip it into your Arduino folder then open the sketch “I2C_Scanner ” and upload it onto your Arduino. Open the serial monitor and the address for your display should be shown in the window. If not check your wiring and run it again.

Arduino GND to Display GND
Arduino 5v to Display VCC
Arduino A4 to Display SDA
Arduino A5 to Display SCL

View attachment I2C_Scanner.zip

IMG_1862.jpg


I2C Scan.jpg
 
Hi Bob,
Uploaded 4x4 keypad test and opened...no compile ...error ...POSITIVE not declared in this scope


Cheers Mike.
 
Hi Bob....well thats weird.....Scanner showing no address found......yet last few days scanner has shown address at 0x3F
 
If you still get nothing the display may be toast but we’re going to soldier on assuming that we got the address . In the IDE goto “File”, “Examples”,”LiquidCrystal I2c”, “HelloWorld” and upload it to the Arduino. Your display should look like the one in the picture.
If not check the wiring using different jumpers and try again.

I recently had some bad jumpers ruin my day on a project. Nothing like having random 35 ohm resisters in a circuit where I thought I had 4 inch jumpers.

Hopefully we can get it working to this point then all that’s left is the stepper.
Good luck . . Bob

HelloWorld.jpg


IMG_1863.jpg


IMG_1854a.jpg
 
Hi Bob,
Weird....scanner not showing address in serial monitor......yet the last few day when I scanned the address showed as 0x3F
 
Hi Bob,
Uploaded 4x4 keypad test and opened...no compile ...error ...POSITIVE not declared in this scope


Cheers Mike.

Ok that’s weird, there is no reference to “POSITIVE” in the sketch. I just downloaded the sketch and it compiles fine.
What version of the IDE are you using? I’m using 1.6.5

IDE.jpg
 
I just tried changing address to last known address of 0x3F...still no change
 
Humm. Tomorrow I’ll try setting it up on a Mega and dig out my Linux Ubuntu Lumptop (it’s old) and see what I get.
 
Hi Bob,
Just tried 1.6.5 compile ok with example...hello world....tried I2C scanner...no I2c device found
 
I swapped SDA and SCL back to pin 20 and pin21 from A4 and A5 and device found in scanner...address is 0x3F
 
Curious - For S&G tried the posted lcd library and only one letter per line printed [kinda like two '0's] and 'positive' not declared - - Now it's coming back to me - Went thru a few libraries till I found one that worked with the displays I had . . Using NewLiquidCrystal 1.3.4 library - 5 meg file, too big to attach . .

Moral of the story - Not all libraries are created equal . . .

Note - IIRC the scanner program can damage the LCD if left running too long . . .
 
Thanks Bob...appreciate all your help and everyones help.

I do prefer Linux to Win...new version of mint is very good.

Cheers.
 
Hi foozer.,..tried all the library's including NewCrystal 1.3.4...I reckon it's looking more like faulty hardware...don't reckon there is much more to try.

Cheers.
 
Hi foozer.,..tried all the library's including NewCrystal 1.3.4...I reckon it's looking more like faulty hardware...don't reckon there is much more to try.

Cheers.

Could be, not that I have ever let the magic smoke out of electronic devices. Have had good luck with displays from adafruit. When it came to figuring out displays, played with OLED's, Touch screens, 16x2's and 20x4's all around the same time so the learning curve details are a bit blurred. Like they say, can be hardware dependent. What works with say the sainsmart, may not work with another supplier product tho newliquidcrystal liquidcrystal_I2C is working here with both sainsmart and adafruit displays.
Both seem to use the same chip PCF8574
 
Thanks Rodw, downloaded and installed all library files and swapped scl and sca pins to A4 and A5 ran sketch...;error was 'BYTE keyword no longer supported.'


Cheers Mike.
Mike, there is too much static on this thread. This is where you should be starting. You are not thinking about the problem or your hardware.... and just blindly following suggestions made by others based on your hardware.

Did you google the error? Get this correct demo script working first.

They have done some stuff in the lines that look like this
Code:
lcd.print(0x30+val/100,BYTE);
What they are doing is printing a decimal value without resorting to floating point maths which is not supported by lcd.print()

The problem is a BYTE is not a valid data type in C. Bytes are equivalent to char but if you use char instead of BYTE here, the Arduino will think you want to print text. Arduino must have once had a typedef for BYTE but the typedef has been removed.

Try one of these two formats instead....
Code:
lcd.print(0x30+val/100);
//or
lcd.print(0x30+val/100,int);
Make sure you change all lines with BYTE in it.
See https://www.arduino.cc/en/Reference/LiquidCrystalPrint

This should work. Worst case delete the lines with compile errors as there is enough being printed in setup() to confirm it works.
 
Hi Rod, I tried earlier deleting BYTE after I googled the error...no improvement.....but this time I'm using 1.6.5 Ide and as you suggested I deleted 3 ptint lines with BYTE in them...now I have a Zero and a flashing Cursor row A Col 19.....No keypad on Sketch so now have included...#include <Keypad.h>....no improvement so have swapped keyboard wires opposite to each other still starting at pin 4 through to pin 11 and changed address to 0x3F.

Will see if I can get some more letter up.

Cheers.
 

Latest posts

Back
Top