
Hi to all today i managed to switch on my Arduino mega 2560 and uploaded the sketch that studog86 posted .I am waiting for my RTC so I can start the project.
![]()
Hi to all today i managed to switch on my Arduino mega 2560 and uploaded the sketch that studog86 posted .I am waiting for my RTC so I can start the project.
![]()
I noticed you haven't set up any pots for your backlight, or contrast. That would make a huge difference on how your GLCD looks. I allows you a lot of adjustments to tune in your GLCD. You could get some cheap ones from Radio Shack for less than a dollar. You will also need two more for manually dimming your Strings of LEDs for acclimating to animals. I can send a picture on how to wire those up if you need it.
I am doing a LED with 4 meanwell "p" and from the Led and the meanwells I am going to have about 1.2m Can I use a VGA cable to connect them or I need ticker cables?
That's interesting question. I was always wondered how to properly calculate optimal wire gauge for different projects. Amperage and wire length are two things that define gauge. Or not ?
Googled a bit and found table for cooper wires :http://http://diyaudioprojects.com/Technical/American-Wire-Gauge/
According it :
0.35A need at least 26 gauge wire (0.13 mm2 = d 0.40 mm)
0.7 A need at least 23 gauge wire (0.26 mm2 = d 0.57 mm)
1.0 A need at least 21 gauge wire (0.40 mm2 = d 0.72 mm)
Please correct me if wrong.
I am doing a LED with 4 meanwell "p" and from the Led and the meanwells I am going to have about 1.2m Can I use a VGA cable to connect them or I need ticker cables?
Most typical VGA cables are around 24 gauge. That gauge could run a 12volt 3.5 amp signal no problem. I am not sure what current you are trying to run but I have nothing running through my Arduino thats even comes close to that.
I have 1 pot but it is just under the wires .
![]()
you know what can help if you can try to post a sketch on how to wire all the things and pins you are using as I am very very green on these things .
For Blue lights, use pin PWM 2
For White lights, use pin PWM 4
For Fans use pin anaolg 0. Whoops, I mean A0.
These values are easy to change
int blueramptime = 60 ; // time for blue LEDs to dim on and off in minutes
int whiteramptime = 120 ; // time for white LEDs to dim on and off in minutes
int bluemin = 0 ; // minimmum dimming value of blue LEDs, range of 0-255
int bluemax = 255 ; // maximum dimming value of blue LEDs, range of 0-255
int whitemin = 0 ; // minimum dimming value of white LEDs, range of 0-255
int whitemax = 255 ; // maximum dimming value of white LEDs, range of 0-255
int photoperiod = 540 ; // amount of time array is on at full power in minutes
int ontime = 10 ; // time of day (hour, 24h clock) to begin photoperiod fade in
int blue = 2; // blue LEDs connected to digital pin 2 (pwm)
int white = 4; // white LEDs connected to digital pin 4 (pwm)
int fan = A0; // Fan power relay connected to analog pin 0
int fuge = A1; // fuge light power relay connected to analog pin 1
int moon = A4; // moon light power relay connected to analog pin 4
When you use int, you are introducing to Arduino what pins you will control later in sketch.
Change int blue, white to any pwm switch you would like, and int fan can be changed as well.
Dimming time for blue and white, and total time at 100 percent brightness can also be changed.
These are in increments of minutes. int blueramptime, int whiteramptime and photoperiod. When you are testing change all three to 2 minutes, so you dont have to sit around for 11 hours.
Whenever you change any value make sure you compile sketch, just in case you did something wrong. If you dont, bad things can happen.
Hi to all today i managed to switch on my Arduino mega 2560 and uploaded the sketch that studog86 posted .I am waiting for my RTC so I can start the project.
![]()
Yes I mean that. Not a big trouble - just aesthetic thing. But more important, that i hardly can leave puzzle unsolved![]()
I am not yet and Arduino programmer (so not familiar with the pecularities of this processor), but I do program for a living. But here is a comment. I keep seeing lines like:
int blue = 2; // blue LEDs connected to digital pin 2 (pwm)
This allocates a memory location and sets it to a value of 2. Unless you are going to change it this seems to me a waste of memory. It seems to me you would be much better of using
#define blue 2 // blue LEDs connected to digital pin 2 (pwm)
or since it is constant most programmer I know use upper case
#define BLUE 2 // blue LEDs connected to digital pin 2 (pwm)
Now any time BLUE is used in the code the compiler will subsistute 2. Your code may also run faster since it may require fewer memory accesses to obtain the value (depends on how it behaves).
That is one gorgeous LCD. Wish I can learn to program the same... Some other time maybe.
Have you looked at my sketch, I was able to add a 0% at the end to read 00% to 100% granted I am using GLCD.print instead of LCD.print but it worked for me. Arduino still spits single digits but I cheated and just printed a 10ths place 0 at the end, works great.