Flow Controller

The Homebrew Forum

Help Support The Homebrew Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
belter test the uno with the flashing led example sketch and then if sucessful build a diddy sketch to set the gpio pins 1 by 1 hi and low and test the voltage with a meter between the pin and ground low should be off hi should be +5v
a paperclip makes a quick pin to contact a uno board socket..
 
Cheers Fil. I made the LED blink on setup. I'll try what you said tomorrow. Thanks
Mate!
 
This is the reply I got from the Ebay seller:


Hi there,

Thank you for letting us to know this issue.
I am sorry about all the inconvenience. Don’t worry, we are concerned to help you.

Here is the code and manual for the LCD:
https://s3-ap-northeast-1.amazonaws.com ... CD1602.rar
https://s3-ap-northeast-1.amazonaws.com ... pad1.0.rar
Please test the item again with the manual.

If your problem still cannot be resolved, please feel free to contact us by Ebay message. We are glad to provide you a solution.

Best regards,
Samantha

After wading my way through the files involved it goes way over my head.

I tried adding a library in the hope that would help but it wouldn't compile after. I tried pasting the examples into a Sketch but they also wouldn't compile.

Am I missing a library to make this work?
 
I set Pin's 4,5,6,7,8,9 to High and they all output 5V. So do 0 and 1 but I assume thats for good reason. So I assume the Uno is fine and the Shield is F'd.
 
just looked at the files and in the i opened i found readme.txt which contained the following test code

Code:
#include <LCD4Bit_mod.h> 
//create object to control an LCD.  
//number of lines in display=1
LCD4Bit_mod lcd = LCD4Bit_mod(2); 
//Key message
char msgs[5][15] = {"Right Key OK ", 
                    "Up Key OK    ", 
                    "Down Key OK  ", 
                    "Left Key OK  ", 
                    "Select Key OK" };
int  adc_key_val[5] ={30, 150, 360, 535, 760 };
int NUM_KEYS = 5;
int adc_key_in;
int key=-1;
int oldkey=-1;
void setup() { 
  pinMode(13, OUTPUT);  //we'll use the debug LED to output a heartbeat

  lcd.init();
  //optionally, now set up our application-specific display settings, overriding whatever the lcd did in lcd.init()
  //lcd.commandWrite(0x0F);//cursor on, display on, blink on.  (nasty!)
   lcd.clear();
  lcd.printIn("KEYPAD testing... pressing");
}
void loop() 
{
adc_key_in = analogRead(0);    // read the value from the sensor  
digitalWrite(13, HIGH);  
key = get_key(adc_key_in);    // convert into key press
	if (key != oldkey)	// if keypress is detected
	{
    delay(50);		// wait for debounce time
    adc_key_in = analogRead(0);    // read the value from the sensor  
    key = get_key(adc_key_in);    // convert into key press
    if (key != oldkey)				
    {			
      oldkey = key;
      if (key >=0){
      lcd.cursorTo(2, 0);  //line=2, x=0
  	lcd.printIn(msgs[key]);
      }
    }
  }
  digitalWrite(13, LOW);
}
// Convert ADC value to key number
int get_key(unsigned int input)
{	int k;
	for (k = 0; k < NUM_KEYS; k++)
	{
		if (input < adc_key_val[k])
		{  return k;  }
	}
    if (k >= NUM_KEYS)
        k = -1;     // No valid key pressed
    return k; 

}

the LCD4Bit_mod.h lib is embedded in the second rar file lcd1602.rar... so un-zip that and place the libs in the arduino ide libs folder and try compiling/verifying again :)

if u got that far already i will have a deeper look later..

ps edit.. yes id agree the uno sounds fine.. solid state stuff generally either works or dosent
 
I haven't managed that yet. I did try adding a Library but its different on a Mac. I don't have any folders
 
Ok i refer u to the arduino playground mac pages for definitive instructions on how to install resources,
but at least the rar files should be native ;)

However you should have directories ? same thing as a folder, just Micro$haft speak.. and it should be a simple drag n drop exercise, you just need to id the correct target :)

i imagine you have a directory under the main arduino ide directory called libraries. id bet a fairly safe pint on you just unzipping the embedded library compressed file embedded in the rar file u downloaded ( yes rar files in a rar file, not quite recursion hehe) .. but check things with the arduino playground i dont do apple mugs often.

the files themselves should be identical as they are just text files used as the source.

to confirm you have copied it over correctly check the layout of the contents of other resources in the libraries directory, your new lib directories contents should follow the same format..

and once you have added one resource adding another is not such a big deal..
 
Oh and if it is installed correctly after restarting the ide (may not be needed??) you should be able to pull up the lcd example sketch thru the arduino ide file->examples menu option ;)
 
Ok Phil, I've had a play and apparently I was installing libraries correctly after all. As with everything Mac I just click on it and it adds. Amazing.

However, when I tried to compile the example it comes up with an error in the code and wont compile.

China have got back to me and said they'll replace the shield.
 
Welcome to the codeface..


a compiler error is a s/w issue :) so no indication of a h/w prob yet.

its probably down to dodgy version control or a total lack of it with the reseller of the shield. it was probably developed tested and documented under the 1.0 version of the arduino ide..

as im shooting blind on a puter without the ide and its been a while since i faced this issue the best reasource is the arduino playground and its support forum, basing your search on version change... iirc between ver1,0 and 1.01 a basic i/o lib needed a rename..
with ver 1.05 and example s/w developed under 1.00 there could be a couple more i need to bone up on myself..

to debug the prob we need both the error highlighted and the lines from the scroll n roll window below.

**edit while it may look oblique it will contain all the clues to whats going on and how to sort, and it dont take long to learn read the errors..



again its a safe pint bet its a version control issue..

again once sorted the next similar issue is a doddle ,

it is a steep learning curve as your having to cope with more than just the new programming language but also the framework in which it opperates all at once.

On the plus side once you have sussed the little things that need a tweek to get this h/w up n running it wont take any time at all to sus anything else out.. as nothing else is likely to be as complex as an integrated screen and button system. mainly its a simple on or off state u check n control :)
 
This is what i get:

/Users/Music/Documents/Arduino/libraries/LCD4Bit_mod/LCD4Bit_mod.cpp:29:57: error: WConstants.h: No such file or directory
/Users/Music/Documents/Arduino/libraries/LCD4Bit_mod/LCD4Bit_mod.cpp: In member function 'void LCD4Bit_mod::pulseEnablePin()':
/Users/Music/Documents/Arduino/libraries/LCD4Bit_mod/LCD4Bit_mod.cpp:58: error: 'LOW' was not declared in this scope
/Users/Music/Documents/Arduino/libraries/LCD4Bit_mod/LCD4Bit_mod.cpp:58: error: 'digitalWrite' was not declared in this scope
/Users/Music/Documents/Arduino/libraries/LCD4Bit_mod/LCD4Bit_mod.cpp:59: error: 'delayMicroseconds' was not declared in this scope
/Users/Music/Documents/Arduino/libraries/LCD4Bit_mod/LCD4Bit_mod.cpp:61: error: 'HIGH' was not declared in this scope
/Users/Music/Documents/Arduino/libraries/LCD4Bit_mod/LCD4Bit_mod.cpp:64: error: 'delay' was not declared in this scope
/Users/Music/Documents/Arduino/libraries/LCD4Bit_mod/LCD4Bit_mod.cpp: In member function 'void LCD4Bit_mod::pushNibble(int)':
/Users/Music/Documents/Arduino/libraries/LCD4Bit_mod/LCD4Bit_mod.cpp:73: error: 'digitalWrite' was not declared in this scope
/Users/Music/Documents/Arduino/libraries/LCD4Bit_mod/LCD4Bit_mod.cpp: In member function 'void LCD4Bit_mod::commandWriteNibble(int)':
/Users/Music/Documents/Arduino/libraries/LCD4Bit_mod/LCD4Bit_mod.cpp:99: error: 'LOW' was not declared in this scope
/Users/Music/Documents/Arduino/libraries/LCD4Bit_mod/LCD4Bit_mod.cpp:99: error: 'digitalWrite' was not declared in this scope
/Users/Music/Documents/Arduino/libraries/LCD4Bit_mod/LCD4Bit_mod.cpp: In member function 'void LCD4Bit_mod::commandWrite(int)':
/Users/Music/Documents/Arduino/libraries/LCD4Bit_mod/LCD4Bit_mod.cpp:106: error: 'LOW' was not declared in this scope
/Users/Music/Documents/Arduino/libraries/LCD4Bit_mod/LCD4Bit_mod.cpp:106: error: 'digitalWrite' was not declared in this scope
/Users/Music/Documents/Arduino/libraries/LCD4Bit_mod/LCD4Bit_mod.cpp: In member function 'void LCD4Bit_mod::print(int)':
/Users/Music/Documents/Arduino/libraries/LCD4Bit_mod/LCD4Bit_mod.cpp:118: error: 'HIGH' was not declared in this scope
/Users/Music/Documents/Arduino/libraries/LCD4Bit_mod/LCD4Bit_mod.cpp:118: error: 'digitalWrite' was not declared in this scope
/Users/Music/Documents/Arduino/libraries/LCD4Bit_mod/LCD4Bit_mod.cpp:119: error: 'LOW' was not declared in this scope
/Users/Music/Documents/Arduino/libraries/LCD4Bit_mod/LCD4Bit_mod.cpp: In member function 'void LCD4Bit_mod::clear()':
/Users/Music/Documents/Arduino/libraries/LCD4Bit_mod/LCD4Bit_mod.cpp:139: error: 'delay' was not declared in this scope
/Users/Music/Documents/Arduino/libraries/LCD4Bit_mod/LCD4Bit_mod.cpp: In member function 'void LCD4Bit_mod::init()':
/Users/Music/Documents/Arduino/libraries/LCD4Bit_mod/LCD4Bit_mod.cpp:146: error: 'OUTPUT' was not declared in this scope
/Users/Music/Documents/Arduino/libraries/LCD4Bit_mod/LCD4Bit_mod.cpp:146: error: 'pinMode' was not declared in this scope
/Users/Music/Documents/Arduino/libraries/LCD4Bit_mod/LCD4Bit_mod.cpp:154: error: 'delay' was not declared in this scope
/Users/Music/Documents/Arduino/libraries/LCD4Bit_mod/LCD4Bit_mod.cpp:160: error: 'delayMicroseconds' was not declared in this scope
/Users/Music/Documents/Arduino/libraries/LCD4Bit_mod/LCD4Bit_mod.cpp: In member function 'void LCD4Bit_mod::leftScroll(int, int)':
/Users/Music/Documents/Arduino/libraries/LCD4Bit_mod/LCD4Bit_mod.cpp:225: error: 'delay' was not declared in this scope



f*&k knows why my computer is called Music.
 
Ok I searched the web and found a post how to fix that by putting in one line of code to the library. I did this and the code now compiles. Screen still faulty :D

New shield me thinks
 
Code:
/Users/Music/Documents/Arduino/libraries/LCD4Bit_mod/LCD4Bit_mod.cpp:29:57: error: WConstants.h: No such file or directory

looks like its looking for a file WConstants.h which i would hazard a guess contains the definitions not found in the other msgs..

so search arduino playground for probs arround that file.

my bet is still on version control perhaps its been updated and is called something slightly different now.

just tried the search n got portugese.... will have another peek
 
Fil said:
Code:
/Users/Music/Documents/Arduino/libraries/LCD4Bit_mod/LCD4Bit_mod.cpp:29:57: error: WConstants.h: No such file or directory

looks like its looking for a file WConstants.h which i would hazard a guess contains the definitions not found in the other msgs..

so search arduino playground for probs arround that file.

my bet is still on version control perhaps its been updated and is called something slightly different now.

just tried the search n got portugese.... will have another peek

I don't have this problem now Fil. It compiles after modding the 4bit library. The screen still doesn't work though.
 
Glad the s/w issues are sorted.. and thats pretty much the extent of the fixes you need to apply to any h/w libs out there, once done its easy if needed next time.. just takes a cup of coffee and a google session, and as with anything you soon pick up the search terms that work ...

shame about the h/w tho..

Im sure u checked but just to be sure have you dble checked the documentation and example u used applys to your lcd as often they come in bundles with more versions in the reseller suppled files they may sel 3-4 h/w configurations but supply one support package for all.. i dont have your resourses on this puter either so cant check myself..

i only had a quick peek inside at the file names and the readme, the code i pasted out of that readme as an example may not be applicable????

there should be a model number on the shield somewhere...
 
Glad to hear they will replace it with no hassle, just a shame it had to happen in the first place.

Relay has arrived so just a few more jumper cables and I'm good to test although I may start without them if they are not here by the weekend :)
 
In everything I've read it says stop using outdated libs and just use liquid crystal as it is compatible with the 1602 if you change the pin allocation. Which is what Stevela has done.
 
Belter said:
In everything I've read it says stop using outdated libs and just use liquid crystal as it is compatible with the 1602 if you change the pin allocation. Which is what Stevela has done.

Yes in all the docs I saw the LCD4bit was outdated and didn't have as many functions as the LiquidCrystal so swapped the code over to use that instead.

Got a few hours spare whilst waiting for my next project to be delivered (can't have too many things going on at the same time!) so I thought I'd best test the PSU that arrived, hooked it up to the PID to test both and everything seems OK:

FX4mOSt.jpg


The second single relay has also arrived and is now connected to the board:

UiXz5A3.jpg


All that is left now is to connect the relay to the solenoid and give it a test, just need to set it up so the 240V is safe from any accidental spillage! I think down the line I will get a suitable wall mountable box for the PSU and use XLR connectors and cables to supply 12v to whatever needs it.
 

Latest posts

Back
Top