Show Posts
Pages: 1 2 3 [4] 5 6 ... 86
46  Using Arduino / LEDs and Multiplexing / Re: Lcd shield for arduino? how to use it? on: May 03, 2014, 04:04:29 pm
Look at this --> section 7 about using code tags. Then stop begging for help. It is undignified.

Does the code work with your current setup? Does the Serial.print output give the correct (or close enough) result?

Removing the Servo code is trivial - unless I misunderstood the question - just delete those code lines that use it.
 
So all you want to do is to replace Serial.print with LCD.print ? ... have you looked at the example sketch File->Examples-LiquidCrystal->HelloWorld ?

We all were "newbies" at some point in time. (I noticed your earlier post) If this project is "too much", then try someting simpler first. As you learn by experimenting you will find how to do this.
47  Using Arduino / LEDs and Multiplexing / Re: 3 buttons for 3 LEDS on: May 03, 2014, 03:43:20 pm
There is nothing in you code that is "Limited by the UNO hardware".

From bitter experience I know that cut-n-pasted code-snippets and then changing variable names (your identical code sections that use ...RED, GRN and ...GRN1) is prone to forgetting or mixing up a name. I've looked and didnt find one, but these are hard to see.

PaulRB has asked about the pulldown resistor - this assumes the switch pulls the line high.

There is the possibililty that pin4 is "bad". If you played a lot with your UNO you may have "stressed" the pin. Try using pin 5 instead of 4.

48  Using Arduino / Programming Questions / Re: Can the Arduino do two things at one time? on: May 03, 2014, 03:00:34 pm
Going back to the question in the subject: "Can the Arduino do two things at one time?" the answer is NO.

BUT - by switching between two tasks often enough it will appear to do two (or three, four...) things at the same time.

This is why you see so many posts talk about the "Blink without delay" example, because neither of your two tasks may block - that is, sit in a loop doing something that takes time. They must do such tasks a small step at a time, remember how far they got, and when the loop() gets round to the again, take the next tiny step.

The trick of the "Blink without delay" technique is that the large "delay()" is actually just taken off in small bites by just executing millis() to look at the clock. See if http://playground.arduino.cc/Code/AvoidDelay helps explaining this.

Now, back to the program. I am sorry I have not studied your code. I have just looked if it had the classical error - using delay(). Yep.

"delay()" and "two things at once" are mutually exclusive.
49  Using Arduino / LEDs and Multiplexing / Re: Multiplication in Trinary on: May 03, 2014, 06:30:58 am
That sounds like an interesting project! What are you going to use it for? Pardon my suspicious nature, but it sounds so very much like an exercise given in school/college. I dont do other persons homework.

If it is because it is a nice challenge to programming, then I suggest you start by writing a sketch that can read a button and send a single character to Serial. What you'll find is the first minor hurdle, "switch debounce". When you fix that you can expand the program to count the button 1 pushes and and the answer on Serial when 2nd button is pushed.

If there is a particular issue that dumbfounds you, then post the code you've tried so far and explain what you want it to do, and what it actually does.

Lastly . Where does the "trinary" come in? A LED is a "binary" device (either On or off). Or are your "LEDs" actually digit display (7-seg) and you are displaying a number in trinary (i.e. using digits 0, 1 and 2 only)?
Edit: The OP edited his question explaining the trenary. So my question here is thus superflous.( I dont like edits to top ost that make my answer/help/clarifications seem idiotic.)
50  Using Arduino / LEDs and Multiplexing / Re: Pulsing an led strip on: May 01, 2014, 05:55:46 am
How much have you got working?

Have a look at the Example -> Analog -> Fading. Replace the analogWrite with setPixelColor(). Yes this is a triangular fade-in/out. To make it look "sine wave like" you need to experiment as LED fades never seem "liniear" (twice the number is not twice the brihgtness) - but first get this working.
51  Community / Exhibition / Gallery / Re: Blink without "delay()" - stepping up. on: April 30, 2014, 03:17:42 pm
This is a general problem with "forums" with innumerable "threads" streaming away and no fixed "root" structure.  A Wiki (in addition) would seem more appropriate.
That is what the Playground is - a wiki. Top menubar of the standard Ardino webpage, Learning - Playground. In the left menu selection try "Tutorials", and therein "Protothreading, Timing & Millis", and in that section "How and Why to avoid delay".

(editing post - forgot to add )  I think it is fine to place it here. But before placing it here as a finished example, you could perhaps have let the discussion and suggestions run in Programming.  Your example has at least two errors as others have pointed out.
52  Topics / Robotics / Re: i want to use servos without using delay, help me please on: April 29, 2014, 02:20:29 pm
i don't why it doesn't work
What does not work?

You MUST describe what you EXPECT to happen, and what ACTUALLY happened. Then others will know what error it is you are having. Your description does not even say if it is a compiler error you are getting, or if something is smoking.
53  Community / Exhibition / Gallery / Re: Blink without "delay()" - stepping up. on: April 29, 2014, 02:05:36 pm
Do correct me/ shout me down if this is not the most appropriate place, or if this has so blatantly been done before,
I am far too polite to shout smiley

Anyhow: http://arduino.cc/forum/index.php/topic,76140.html Unfortunatly owing to a strange misunderstanding this is not a sticky, so people who answer have to remember to have their own cut-n-paste bookmark file to refer to it. That example was the result of rather lengthy discussion amongst regular contributors where just about every line was revised to be as correct and educational as possible. http://forum.arduino.cc/index.php?topic=74861.msg56413

There have - of course - been others that have tried to do explain this "how to have several things at once". Many times. There are libraries with "timer classes" so that it hides the complexity (though how using such a library should be easier than remembering 3 lines of code... ? Ah well, we are all different) I've seen at least two attempts to make a new "framework" where loop() has been taken away and people just write sections of code which then get called at the right intervalls.

Despite all that, there will be people that will ask "The Question" - again and again. Partly beacuse it is too difficult to find the refereneces, partly because it presumes they read, think and understand the issue before willy-nilly cut-n-paste code.
54  International / Scandinavia / Re: Kommunikation mellan java och arduino! on: April 23, 2014, 02:30:09 pm
Där är två delar til det

1: Något där ger åtgång til Serial linjen, COM porten.  Det måste du hitta om det inte redan är med i din java kit.

2: Så skal du själv skriva noget til Serial i java og lyssna/läsa det på Arduinoen och det samme modsat (serial.print på Arduinoen og läse det med Serialread i javaen) Du skal själv upfinna din protocol. Den kan vara jätte enkel om det bara är at få et musklick på skärmen tända for en LED på Arduinoen : "skicka 'X' for tänd og skick 'O' for släck". Envägs i dette tilfälde.

55  Using Arduino / Project Guidance / Re: Saving on: April 23, 2014, 05:42:16 am
THis bit of "code" you posted :
Quote
    if((username == "Admein") && (password == "12344")){
     return true;
will not work. But you probably wrote
Code:
    if((username[i] == "Admein") && (password[i] == "12344")){
     return true;
which is why you MUST USE THE [code] [/code] tags around code so [i] shows instead of turning on italics.

until then it is too hard to read your code.
56  Using Arduino / Project Guidance / Re: Speed LCD DISPLAY on: April 23, 2014, 05:17:07 am
Ah, well, as you notice my anwers change as you reveal more of what you ACTUALLY have. Much of the earlier wiring suggestions are not applicable.

That receiver will look for a MODULATED IR signal. So you must either have a special matching package that makes the emmitor IR LED blink at 38Khz (or whatever frequency your particular detector uses) or you must make a circuit that does it. http://electrosome.com/ir-transmitter-receiver-led-tsop1738/ Google around for more.

Otherwise my experience with these modulated IR bems is great! Much more reliable than a simple LED - photodetector, unaffected by ambient light and other disturbances; very suitable for this application. Well worth the money. The simple method is acceptable inside a machine where it is dark.

The programming remains the same, by the way.
57  Using Arduino / Project Guidance / Re: Speed LCD DISPLAY on: April 22, 2014, 03:00:23 pm
The diode emittor is simple, in the sense there are a number of webpages with "diode resistor calculator". Otherwise a simple knowledge of Ohms law (and Kirchhoff to be pendandic) you can work it out with one subtraction and one division. You know your voltage drop (1.3) and you know the current you want given the 5V supply (100mA - seems a bit high to me, half will probably work too). Wiring wise it is a simple : 5V - Resistor - Emitter anode(+) /cathode(-) - Ground. Yes, it does matter which way round you connect the LED.

The receptor is a bit trickier. 3 legs implies something more than a simple photodiode/transistor, but rather some intelligence. The legs being supply (which can be anything from 2.5 to 5.5 V), ground and "data". No clue if "data" is a simple analog value or something more complex. Link to the specs you have quoted from, so we can identify which leg does what. Or it could just be the packaging has a redundant leg.
58  Using Arduino / Project Guidance / Re: Merging i2c-sensor code with SPI SD-card code on: April 22, 2014, 08:48:04 am
No suggestions on where the error lies.

On the other hand, I suggest putting a print in the various MMA7455 routines on entry to see if you "hang" somehow (or goes into never-never land due to some memory overflow/overwrite)
59  Using Arduino / LEDs and Multiplexing / Re: 3x3 LED fading grid on: April 20, 2014, 01:37:50 pm
Your average Arduino  has enough pins so its onw LED to every pin. BUT they are not "analog" out (PWM capable).

Two possibilities - you do "bit bang" - which is a fun way of saying you turn the LED On and Off fast enough in the right ratio in your program to have the same effect.

The other one is to add some extra electronics to multiplex the PWM on the LEDs or even have the external chips do the PWM.

And the 3rd one is to write your specifications a lttle clearer. If each row has the same dimming, then you can either wire the LEDs in series and use the PWM pins you have - you are only steering 3 groups. And some other possible combinations depending on exactly what patterns you want

60  Using Arduino / LEDs and Multiplexing / Re: Current Sharing among LEDs on: April 20, 2014, 12:52:59 pm
How then do they manufacture 100W LEDs?
You can make the individual LED brighter, and you can connect lots of LED in SERIES. If you have enough of them you can have 100V and still only pass 20mA and every LED is bright.
Lastly there are active current regulation circuits - there is one in every "mains voltage" LED lamp.
Pages: 1 2 3 [4] 5 6 ... 86