|
722
|
Using Arduino / Programming Questions / Re: Long Button Press??
|
on: February 27, 2011, 05:38:37 pm
|
(1) Do not use pin 0 and 1 - they are connected to the USB/serial. Well, you can use them with some restrictions, but unless you really have to, then do not use them. (2) Use the internal resistor in the chip. Cheaper (its free) and simpler (no wiring required). void setup() { pinMode(5,INPUT) ; // actually redundant, all pins starts as INPUT digitalWrite(5,HIGH) ; // yes, write to the input pin. There now is a 10k-like resistor to +VE The switch has to wire pin5 to ground to "pull it low" and digitalRead(5) will return LOW. If the switch is open, your digitalRead(5) will be HIGH.
|
|
|
|
|
723
|
Using Arduino / Motors, Mechanics, and Power / Re: 4 dc motors and 4 rc servos?
|
on: February 27, 2011, 02:51:27 pm
|
Well, that took a few minutes of research to follow the links and so on ... Says so on the FAQ of the shield: Can I connect more motors? No, at this time it is not possible to stack the shield or otherwise connect it up easily to control 4 steppers, for exampleSo, how to get around it? The extender you mention, as I read it, only copies each pin twice. Plug in two shields and the will use the same pin (as the Ladyada is wired to use a certain pin for motor 1 (for example). If instead of plugging it in on top of the Arduino you do your own wiring from Arduino pins to the shields .. the FAQ tells which Arduino pin is used for which motor... Digital pin 11: DC Motor #1 / Stepper #1 (activation/speed control) Digital pin 3: DC Motor #2 / Stepper #1 (activation/speed control) Digital pin 5: DC Motor #3 / Stepper #2 (activation/speed control) Digital pin 6: DC Motor #4 / Stepper #2 (activation/speed control) Digital pin 4, 7, 8 and 12 are used to drive the DC/Stepper motors via the 74HC595 serial-to-parallel latch and you do not have enough leftover pins to do board 2. Well maybe, if you leave something out, use some of the analog pins as digital output (but not PWM) and so --- Over to you to do the carefull tallying of pins.
|
|
|
|
|
724
|
Development / Suggestions for the Arduino Project / Re: re-display serial monitor after upload?
|
on: February 23, 2011, 10:03:56 am
|
|
Just One More Button - One that sits between the Upload and Open Serial Monitor buttons.
Yeah! It does both things! Does the upload and opens the serial monitor.
That is simple, allows for all possibilities (upload only, toggle serial monitor, reupload without monitor, reupload with monitor etc and so forth).
But yes, it is another button. Keeping the top button menu simple is an important design aspect, too.
|
|
|
|
|
725
|
Using Arduino / Programming Questions / Re: retaining the last state of a bit before and after powering the board?
|
on: February 21, 2011, 05:48:39 pm
|
Of course, you cant wait to store when power is lost - at that point it is too late.  So you must store your state in EEPROM evey time it changes - just in case power fails. At which point a second problem makes itself felt: These EEPROM can only be set a finite number of times (100.000) at which time they become unreliable. The same is true for your flash-ROM where the program is located (which only takes 10.000? writes). This only happens when you upload a new program so for most purposes it lasts a looong time. When you have a sktech you're likely to write much more often, and then the EEPROM will only last you a few months.
|
|
|
|
|
726
|
Using Arduino / Programming Questions / Re: Question / Problem with ShiftIn register
|
on: February 21, 2011, 03:48:11 pm
|
I agree with you - the fact that you constantly get "11111111" is not correct. Most probable is that you have wired something wrongly. So, check it one more time  Actually, do check it, not just cursory, but check each wire and their pin numbers and tick it off on a hardcopy of your diagram. A couple of times it has happened that although I was willing to swear and write in blood that the circuit was correct ... it wasn't. 
|
|
|
|
|
727
|
Community / Website and Forum / Re: <<next>> <<previous>> looping
|
on: February 18, 2011, 08:07:50 pm
|
I(changed)MHO  Twice in the last few days I was spending too much time on an old post, 'cause I had wrapped to the end by using previous/next. So, I now "vote" for avoiding loping - or at least via a dummy post or popup give notice that wrap has occured.
|
|
|
|
|
728
|
Community / Website and Forum / Re: Solved tags
|
on: February 18, 2011, 09:41:59 am
|
All the tools are already here!  (1) the OP can edit the subject line, adding [SOLVED] in front. I noticed a few threads where this was done. (2) the OP can lock the thread. I suppose if you have something really important you could them PM the OP. So, would a "convinience button" that does the above too help? Possibly, a little I think. I notice that in a fifth or so of threads the OP adds a ThankYou or other conclusion post to their thread.
|
|
|
|
|
729
|
Using Arduino / Programming Questions / Re: sending flow back to the Loop()
|
on: February 18, 2011, 07:54:48 am
|
I may be misunderstanding your question, and my variation of the answer is "no". If you are hoping to do something like: **PSEUDOCODE** // (PaulS, take note :-) )
void loop() { StandbyLoop: : // various code GoFunction() ; : }
Void GoFunction() { : // more code if (something) goto StandbyLoop ; : other code } then this is ILLEGAL. If it could be made to compile and run, it will eat up your stack (run out of RAM memory). Gotos can only be used inside the same function/procedure and not to jump around between them. If you find you "need" this construct, then you have badly represented the external requirements in the logic of the program. Try and explain what you are doing that makes you want to "jump back to the begining". You can code this kind of flow, similar to this **PSEUDO CODE** void loop() { : // Some code if ( GoFunction() ) { : // code that executes when not "jumping back" } }
boolean GoFunction() { : // Code always done if ( ReasonToJumpBack ) return false ; signal to restart main loop : // code done if not jumping back return true ; // signal it went well, continue main loop }
|
|
|
|
|
730
|
Using Arduino / Project Guidance / Re: Newbie: Advice on Kit
|
on: February 14, 2011, 07:49:31 am
|
My suggestion is the "standard" UNO. You need something to convert the voltages/current to drive the stepper motor, and this is very dependant on what steppers there are. Are you buying/mounting the motors or are they already attached, and you just want your own controller? I have bought stuff from http://www.oomlout.co.uk/ - seems OK shop to me. Their experimenters kit ARDX is one of the best ones, great selection, extreemly good examples/documentation for the newbeginner
|
|
|
|
|
733
|
Using Arduino / Interfacing w/ Software on the Computer / Processing.serial <-> Arduino Mega 2560 - fails
|
on: February 13, 2011, 05:19:46 pm
|
|
So I am doing various minor test to do serial processing between my WinXP and the Arduino. I have two, a small (older) ATmega328 and a new Mega2560. The programs work fine if I use the Serial monitor with the Arduino IDE. The programs work fine with my own serial connection using Delphi(Pascal) The programs work fine with the (6 month old) Arduino Duemilanove ATMega328 and the Processing (latest) with the Serial calls The programs do NOT work with the ATMega (that uses the ATMega8U2 chip) the Processing (latest) with the Serial calls Yes, I have checked the correct COM port, the right Arduino board and serial baud rate. Umpteen times. It is only that specific combination The Mega/8U2 and Processing Serial lib. Symptoms ? Thing goes haywire; the RX lights up nearly always, the LED13 lights up. Irrespectve of what program is or is not loaded in the Arduino (like the starter Blink code). I suspect something makes the Arduino go into its bootloader - some setting of the DTR/CTS/or-more-subtle item. Apart from that it will not talk to Processing.Serial the board works fine otherwise. Bug in Serial? Unusal H/W failure on my board? Wrong phase of the moon ?
|
|
|
|
|
734
|
Community / Bar Sport / Search: Processing, Serial, Arduino
|
on: February 13, 2011, 04:01:38 pm
|
Life is hard, and then you die ]  At the moment I am fighting a problem with the Processing language, the Arduino and the Serial library in both ends. That is not the point of this thread, it is the expletive deleted impossibility to search for a hint using these keywords! The words Processing and Serial aren't exactly high selectivity!  Neither here, at Processing's forums or Google ....  Off for a beer ... 
|
|
|
|
|
735
|
Using Arduino / Programming Questions / Re: Splitting an string coming from Serial
|
on: February 12, 2011, 07:25:03 pm
|
Wow, I am happy for you, too. Of course you realise that you have improved the communication so a single byte contains both the LED code and the value ... at the cost of only having 64 distinct values for the brightness. If that is sufficient then it is a great solution! I am slightly baffled why my suggestion didnt work. Apart from the int((fader[n)umfader]*1000)/4); thing that should have worked. Unless there where other differences between your post and the code.  I also notice that sometimes you use arduinoPort.write() and sometimes arduino.write(). I suspect some confusion arises from that. I have not tried this processing interface to arduino so I done know what type they take and we're getting different casting/conversion of the types (which would explain a lot, too) Well, seems I have to get a copy/install of the Processing extension to talk to the Arduino. (I use Processing for some standalone fun, and have done my own Delphi/Pascal based communication stuff for other projects)
|
|
|
|
|