Show Posts
Pages: 1 ... 3 4 [5] 6 7 ... 86
61  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.

62  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.
63  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.
64  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.
65  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)
66  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

67  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.
68  Using Arduino / Project Guidance / Re: Need some help on a ultrasonic sensor problem on: April 20, 2014, 02:12:56 am
Time to look at the circuit. Somewhere there is a ground missing or you are picking up (electrical) noise. If you have schematics fine, but a phone-snap ofa handdrawn one can do. Also perhaps a picture of the physical setup, particular the problematic power supply wiring.

The Arduino either needs the USB or 5V regulated, clean on the VIN pin, or 7v to 12V on the barreljack (where it goes through the onboard regulator). You wrote 6V ... which goes where?

I did not see the setup for the ultrosonic sensors in your code. How are you reading them (analog or I2C or SPI ...). Analog pins are default input, which may start explaining your difficulty - the analog read needs a reference and if you do not have the correct supply voltage it will derive the wrong reference from VIN.
69  Using Arduino / Project Guidance / Re: Need some help on a ultrasonic sensor problem on: April 19, 2014, 04:16:58 pm
What does your setup code do? How is the circuit handling the inputs before setup has correctly configured pins? Does all this different powersupply include if the Arduino USB is connected or not? (this makes the timing for powerup change as the bootloader does some probing) How do you power the circuits (not the Arduino)?

And last but not at least : is this a real problem? Rephrasing: what would be wrong in supressing any sensor input for a short while (f.ex. the first round of the loop() ?) Having written that, I want to contradict myself by pointing out, that finding the root cause of any "suspicious" behaviour in a program or system is good. Ignoring or supressing it hides some other error, that may be worse.
70  Using Arduino / Programming Questions / Re: 3phase signals 120 degrees out of phase for mega2560 on: April 19, 2014, 04:03:24 pm
I suddenly lost intrest in replying ....
71  Using Arduino / LEDs and Multiplexing / Re: How to turn on 8 leds through http server of arduino? on: April 19, 2014, 03:52:34 pm
Hello, I am Somebody smiley-wink

What Arduino are you using?

A frequent "beginner" problem is running out of RAM, due to a program being too verbose, using to many text constants, using the String packaage needlessly or a library which need a large chunck of the RAM. I think you've managed all of these. Another typical mistake is to think that the compilers last message "used 8.764 bytes of 30.024 avaialble" has anything to do with RAM.

Suggestion 1: comment out all varaibles and code used for pins 2-7, so the program now only handles 8 and 9. If that works, uncomment so you have pins 7, 8 and 9. And so on, and notice if the program "breaks" when going above.

Rhetorical Question: What are you doing with variable "state8"? You assign one of two character string - effectivly you are signalling a two value logic yet you are using a String type variable. Use a single byte. In your webresponse code use a
Code:
if ( state8 == true ) cliente.print("ENCENDIDO") ; else cliente.print("APAGADO");
That will save heaps of memory.
(Edit: Note:Yes the "==true" is reduntant, but the compiler knows that, and it explains the code clearer for this particular learning experience)

Actually I do not know why your program failed - or what the failure is (you have not explained what you expected the output to be and what it actually produced ... although I can make a pretty good guess, I would rather read your version - I may have guessed wrong). I have simply assumed you have run out of RAM.
72  Using Arduino / LEDs and Multiplexing / Re: How to make LED flashing in different states on: April 19, 2014, 03:29:05 pm
Quote
Code:
void setup()
{
  pinMode(11, OUTPUT);
}

void loop()
{
  digitalWrite(11, HIGH);
  delay(100); // Approximately 10% duty cycle @ 1KHz
  digitalWrite(11, LOW);
  delay(900);
}
Will work - in the sense you have a constant semi-bright LED - if you replace the delay() with delayMicroseconds().

So next step is to use two int variables, lowRatio and highRatio, giving them the values 100 and 900.
Then you put in the button code that - say - puts the values 200 and 800 respectivly. This should change your brightness.

Having put these delays into your main loop code, your loop() is limited to run once a millisecond. That is OK for such a short demo program. The challenge is to replace the two delays with one construct using two "timervalues" based on the "blink without delay" example sketch. That way your loop can run unhindred at near Mhz speed - which may be important for other tasks your bigger programs will need.

NB: You do not need to do ALL example sketches smiley-wink only the ones that contain relevant peripherals for your projects. But then if you want to learn EVERYTHING about C++ then you're going to need to read all examples and the source of the libraries and core. smiley-wink
73  Using Arduino / LEDs and Multiplexing / Re: Current Sharing among LEDs on: April 19, 2014, 03:13:26 pm
Ah yes - this brings back fond memories. My first LED circuit with a single RGB. Being used to mathematics and programming where factoring out a common component is a correct and good practice, I applied the same to all those resistors I had on all those LEDs down to a single resistor.

I then spent a number of hours trying to understand why I could not get the RGB colour rainbow code to work, thinking I had a software problem.

The cause - you can NOT factor the resistors round that way. Each LED its own resistor. Lesson learned. <snift>
74  Using Arduino / Project Guidance / Re: Advice on Tower Stacking Game using 8x8 LED Matrix on: April 19, 2014, 02:03:47 pm
Playing the game, and representing it on the 8x8 matrix are two seperate things. Fortunatly.

Start with writing the game playing code using Serial.print to show output. When that works, then you can worry about how to display it on the LED array. I'd even start with using Serial input rather than button pushes, to get the game logic debugged, completly. Then add button input, then add LEDs. Keep the Serial prints, that way you can verify that you did not disturb the game logic by adding calls to LED display

Or - you can write LED display routines, where you input the state to display as a Serial-input  That way you are disconnected from the worries of button debouncing and game logic. You can add these when the LED display routines are working and fault free.

My slant on doing the LED display is to allocate an array (you did not say if it is monochrome or two or RGB LEDs, I'll assume mono). of 8 bytes. You make LED display routine that will display the bit values to each LED (ie one bytes 8 bits are one row of the LED display). This makes the moving bar very easy - you just use the << or >> operator on the correct row, and then call your display refresh routine.

One thing is for certain. If you want to do blinking of LEDs and all that, you must understand writing a couple of independent timeloops - the grandfather of this is "the blink without delay" example sketch.
75  Using Arduino / Project Guidance / Re: 2 Stepper Motors with 300 to 600 rpm on: April 19, 2014, 10:52:18 am
Apperently, I did not explain it well enough.smiley

If you give 13V external supply to the Motorshield, the shield will supply (slightly less)V to all coils of all steppers as appropiate to step them. This is enough to go 600rpm for a "typical" stepper motor. The Nema17 is probably too big for your needs. "too big" means it will work, but your machine wil be needlessly large/heavy, and the stepper motors own vibrations wll mess up you resuts (of course I do not know how you mecahnically have thought to transfer the rotation to the excentric. If it is via a long flexible "wire" then it may not matter).. The voltage is a requirement for the motor to turn that fast, but it is NOT what regulates the speed. That is done via the step-pulses you send to the motors, from the Arduino, by using the library supplied.

As Grumpy_Mike has pointed out, the Adafruits Motorshield has its limitations - most notably it has no current regulation. The Nema17 is rated at 1.5 A, and the driver chip is rated at 1.2.A.. If you suppy the 13V, the internal reistance is only 1.3Ohms so up to 10A could pass through your motor (ruing the permament magnets) unless your power supply limits it (it proably will) or the chip burns out (blue smoke.... smells bad). So you must only drive it it with a few volts - but then you can not reach speed.

The other driverchip suggested does have a current limit - here you can give it 30 V but it will "chop" (meaning turing the circuit on/off very quickly so the average current is the desired level). There is a small adjusting screw to set the current.

By The way, you do not need to drive the Nema17 with 1.5 A - that is its maximum if you need maximum torque. You probably do not need that. And as I wrote, you can choose other steppers, probably smaller. But you need to read their spec sheet for max step rates (or RPM) voltage and current maximums.
Pages: 1 ... 3 4 [5] 6 7 ... 86