Show Posts
Pages: 1 2 3 [4] 5 6 ... 25
46  Forum 2005-2010 (read only) / Troubleshooting / Re: LED light timed cycle problems on: September 22, 2008, 11:27:07 pm
you mean like this?

Code:
// Daytime LED


int value = 0;                            // variable to keep the actual value
int ledpin1 = 11;                           // light connected to digital PWM pins 3 - 11
int ledpin2 = 10;
int ledpin3 = 9;
int ledpin4 = 6;
int ledpin5 = 5;
int ledpin6 = 3;

void setup()
{
      pinMode(ledpin1, OUTPUT);  // nothing for setup
      pinMode(ledpin2, OUTPUT);
      pinMode(ledpin3, OUTPUT);
      pinMode(ledpin4, OUTPUT);
      pinMode(ledpin5, OUTPUT);
      pinMode(ledpin6, OUTPUT);
    
}

#define set_pins(value) digitalWrite(ledpin1, value);digitalWrite(ledpin2, value);digitalWrite(ledpin3, value);digitalWrite(ledpin4, value); digitalWrite(ledpin5, value); digitalWrite(ledpin6, value); delay(84705);

void loop()
{
        for(;;) {
                for(value = 0 ; value <= 255; value+=1) {
                        set_pins(value > 127);          // sets 0 for 0-127, 1 for 127-255
                }
                for(value = 255 ; value <= 0; value+=1) {
                        set_pins(value > 127);          // sets 0 for 0-127, 1 for 127-255
                }
                for(value = 0 ; value <= 255; value+=1) {
                        set_pins(0);
                }
                for(value = 255 ; value <= 0; value+=1)   { // fade out (from max to min in 255 steps)
                        set_pins(0);
                }
        }
}

47  Forum 2005-2010 (read only) / Troubleshooting / Re: LED light timed cycle problems on: September 22, 2008, 08:01:52 pm
hey thnx for the input i'll try things and will get back to u smiley

(edit)
@ mem:

I put in your code suggestion and am wondering at what point does the LEDs switch on? im guessing at the 3 hour mark? or is it supposed to be on as soon as the prog starts?if its the latter than nothing is happening, no lights. if its the 3 hour thing then i'll leave it running and watch.

I have also burned mikalhart's code to one of the other chips to see if it runs better than the one i had b4.
48  Forum 2005-2010 (read only) / Troubleshooting / Re: LED light timed cycle problems on: September 22, 2008, 10:55:13 am
i was using 0012

i dont think i used 0011 either wen i uploaded the 1st version of code smiley-sad

not sure whats going on really im wondering if its hardware realted some kind of feedback on the pwm pins messing it up maybe? i dunno :S
49  Forum 2005-2010 (read only) / Troubleshooting / LED light timed cycle problems on: September 22, 2008, 06:58:56 am
I am making a project to have a set of LEDs fade in over a period of 6 hours, and then to fade back out again during a period of 6 hours. with a 12 hour period where they are off, then the cycle starts again.

I messed with the fading led sketch and got a bit of help from a programmer or 2 that i know to get the thing refined and to get the correct delay setting to make it work over the time period i desired.

for those who want to know its a prototype for a LED grow light setup i am making to give my plants a bit of extra light during the dark months over winter (i live in Norway in the polar circle, and we get 2 months of dark with no sun at all),so using some ultrabright LEDs i hope to help them out until the spring.

here is the code i have at present (running on 3 chip setups: one a lillipad bootloader on internal clock, one with dec bootloader on a 16 MHz crystal on a breadboard, and one with a 16 MHz osc on a Dcore board {thnx John Ryan})

Code:
// Daytime LED


int value = 0;                            // variable to keep the actual value
int ledpin1 = 11;                           // light connected to digital PWM pins 3 - 11
int ledpin2 = 10;
int ledpin3 = 9;
int ledpin4 = 6;
int ledpin5 = 5;
int ledpin6 = 3;

void setup()
{
  // nothing for setup
}

#define set_pins(value) analogWrite(ledpin1, value);analogWrite(ledpin2, value);analogWrite(ledpin3, value);analogWrite(ledpin4, value); analogWrite(ledpin5, value); analogWrite(ledpin6, value); delay(84705);

void loop()
{
        for(;;) {
                for(value = 0 ; value <= 255; value+=1) { // fade in (from min to max in 255 steps)
                        set_pins(value);
                }
                for(value = 255; value >=0; value-=1) { // fade out (from max to min in 255 steps)
                        set_pins(value);
                }
                for(value = 0 ; value <= 255; value+=1) {
                        set_pins(0);
                }
                for(value = 255; value >=0; value-=1)   { // fade out (from max to min in 255 steps)
                        set_pins(0);
                }
        }
}

am currently running this code (cleaned up by a friend from the old setup i hashed up from the fading led sketch) on all 3 to see if the problem is hardware related.

You see the problem is that at some point during the cycle the LEDs fail to dim, or are in the dimming part of the cycle and go to full brightness, or are in the fading in part and just speed up to full, and then stay like that.

when i ran the prog with a 50 ms delay it ran fine for well over the time i was running the realtime one. no problems for what i could see, it faded in to full, faded out and was off for the same amount of time.

the LEDs are ultrabright ones of 3.2V or 3.5V (blue and white, i would like to have red but don't have any), not sure what resistors to use so any suggestion would be good.
And they are using all the default pwm pins (3,5,6,9,10,11)

i hope this is enough info and would really appreciate any input from those of u who know more than i do smiley-grin about programming and the hardware.

thanx

Bng. smiley-wink
50  Forum 2005-2010 (read only) / Troubleshooting / Re: Smaller Arduino? on: September 22, 2008, 07:03:39 am
yea like asp said u can basically adapt the breadboard setup like here:

http://www.instructables.com/id/uDuino-Very-Low-Cost-Arduino-Compatible-Developme/%20#allsteps

i have used this method to make a homebrew mini board based on a lilipad bootloader, works a charm and i program it with a home made rs232 to ttl converter.
51  Forum 2005-2010 (read only) / Troubleshooting / Re: Usb broken cannot program arduino diecimila on: August 16, 2008, 06:51:58 am
an rs232 to ttl circuit is pretty easy to build if u got the bits..

rs232 to ttl build

that link should take u thru the process smiley

on the arduino board u would need to power it and conect the converter to the tx, rx, reset, gnd, and +5v pins.
52  Forum 2005-2010 (read only) / Troubleshooting / Re: infitite loop on: April 11, 2008, 07:38:42 am
that programmer cable works great on the new IDE smiley-wink
53  Forum 2005-2010 (read only) / Troubleshooting / Re: Getting a serial board on: April 07, 2008, 12:09:51 pm
have you tried NKC electronics? theere was also another seller on ebay..
54  Forum 2005-2010 (read only) / Troubleshooting / Re: Need basic rs232 cable schematic for boarduino on: April 07, 2008, 09:03:54 am
latest update.. the cable has been working like a dream for ages now and i finally made a board for it, serial transfer works fine both ways smiley-grin and i use it all the time on my Boarduino..

I have also made a thread on my forum detailing (I hope) how it was built and shows a pic of the over sized board smiley-grin but who cares :3
I have also linked it back here to this thread to show where i got the help from.

RS232 to TTl Converter topic
55  Forum 2005-2010 (read only) / Troubleshooting / Re: Need basic rs232 cable schematic for boarduino on: January 21, 2008, 11:42:19 pm
well its helped loads smiley
56  Forum 2005-2010 (read only) / Troubleshooting / Re: Need basic rs232 cable schematic for boarduino on: January 21, 2008, 08:39:41 pm
the layout i have right now works good.. all it needed was the reset line moved. its a good cable smiley u have no idea hoe grateful i am for that schematic..

I hope to have a board made soon with the design i threw together this morning.

that schematic i a lifesaver smiley
57  Forum 2005-2010 (read only) / Troubleshooting / Re: Need basic rs232 cable schematic for boarduino on: January 21, 2008, 03:50:25 pm
Quote
BongMaster,

I edited the previous post: the file in the link now can be opened.

I forgot to say:
if you want to use the cable only to upload sketches, no problem.

If you want to use the cable to transfer data to/from computer, you should use a bipolar electrolitic cap at C8. It's not critical (cable will work if polarized cap is used), but the correct component.

And I told you: I don't know nothing about Boarduino Schematics, only by pics, so I really don't know why Auto reset is not working. It doesn't work with C4? With wire instead? both?

tried both ways.. and hit the reset button at the right time on the last attempt and it worked fine smiley its a small price to pay to have to manually reset tho smiley now i gotta make it more permanent :S

thnx again I'll re download the files

(edit) I see why the autoreset didn't work after i looked at the boarduino schematic again. i moved the rts wire from pin 2 on ure schematic to pin 6 where the reset line is on the boarduino and that worked smiley-grin seem pin 2 is null in this smiley
58  Forum 2005-2010 (read only) / Troubleshooting / Re: Need basic rs232 cable schematic for boarduino on: January 21, 2008, 02:11:06 pm
YaY it worked! smiley-grin thnx so much smiley this mess of wires and componants on my breadboard actually uploaded the blink sketch ok smiley-grin i had to manually reset tho for it to work.. dunno why, will look into it smiley

i will try and make a pcb to hold it all, i had to redraw the schematic and mess about til i got a good enough single sided layout. i hope i can make it without etching :S i have no etchetant smiley-grin so i'l have to engrave it or something. unless anyone knows a way to etch with household stuff smiley

thanx again smiley-grin
59  Forum 2005-2010 (read only) / Troubleshooting / Re: Need basic rs232 cable schematic for boarduino on: January 21, 2008, 12:44:13 am
The files wont open smiley-sad eagle keeps coming up with an error message saying they could be damaged or something. same for both of them..

downloaded them several times to be sure.
60  Forum 2005-2010 (read only) / Troubleshooting / Re: Need basic rs232 cable schematic for boarduino on: January 20, 2008, 11:07:31 pm
thnx smiley i believe i have all the bits now smiley would it be possible to have the Eagle files so i can work out a small pcb design for this?

it would be a big help smiley

and thnx so much for this smiley i hope it works smiley-grin
Pages: 1 2 3 [4] 5 6 ... 25