You look like a nice and
You look like a nice and cool guy. By the way would the code work on the arduino Duemilanove too?
You look like a nice and
You look like a nice and cool guy. By the way would the code work on the arduino Duemilanove too?
Yes it will. You just have
Yes it will. You just have to change the analog pin number from 54 to whatever you are using on the Duemilanove.
Iâm only using the Mega because it is what I have. Itâs HUGE overkill for this robot.
**nice **
you got further then my arduino start here robot
Strange coding thoughâŠOn
Strange coding thoughâŠ
On the duemilanove you would need to address the pin with itâs âpin numberâ when using pinMode and digitalWrite, while you would use a number from 0 to 5 (duemilanove has 6 analog inputs) when using the analogRead. Iâll explain myself better: letâs say you want to set the first adc pin as input and activate internal pull-ups, you would do something like this:
pinMode(14, OUTPUT);
digitalWrite(14, HIGH);
and to read from the SAME analog pin youâd write:
analogRead(0);Â
For pinMode and digitalWrite you gotta start counting from the first arduino pin, and analog ones come right after. For analogRead you start counting from 0, which represents the first pin. You may want to write it down in case you want to make an arduino-based SHR so that folks using duemilanoves can get it working :=)
ps: you probably know this much better than meâŠmain purpose of my post was just reminding :=)
Â
Nice SHR!
NICE example SHR! Great video explanation - something I need to do in my own videosâŠ
I really ought to get an order in to Ro-Bot-X for his robo-shield. I seem to keep building the SN754410NE on a breadboad shield for a quick test project, then tear it down, then later end up building it all over again. Would probably spare me some wasted time and effort⊠:-/
Â
Thanks for your help both
Thanks for your help both
Thumbs Up!
Nice to see youâve joined the âShow Your Face Clubâ @ LMR. Â Keep up the good work !
Actually, since Iâm totally
Actually, since Iâm totally new to the Arduino, it is an interesting point. I read that about the Duemilanove. When it came time to code, I figured out I would need to use pin 54 for my pinMode and digitalWrite commands to set the pullup high, just as you say. But why declare a second variable just so the pin matches the printing on the board?
Since I wasnât used to this convention, I kept it simple and used the same variable storing â54â for the analogRead command as well. It worked fine, but it is helpful to know that Arduino convention is as you describe it. Thanks for the education. ; j
Welcome!I just thought you
Welcome!
I just thought you couldnât adress the pin the same way as you did with pinMode/digitalWrite. Thatâs what the reference on arduino.cc says:Â
pin: the number of the analog input pin to read from (0 to 5 on most boards, 0 to 7 on the Mini and Nano, 0 to 15 on the Mega)
âŠguess they gotta update it! :=)
You can use both, the
You can use both, the digital pin number or the analog channel number. See the Arduino code:
Â
int analogRead(uint8_t pin)
{
        uint8_t low, high;
#if defined(AVR_ATmega1280) || defined(AVR_ATmega2560)
        if (pin >= 54) pin -= 54; // allow for channel or pin numbers
        // the MUX5 bit of ADCSRB selects whether weâre reading from channels
        // 0 to 7 (MUX5 low) or 8 to 15 (MUX5 high).
        ADCSRB = (ADCSRB & ~(1 << MUX5)) | (((pin >> 3) & 0x01) << MUX5);
#else
        if (pin >= 14) pin -= 14; // allow for channel or pin numbers
#endif
I prefer to use the analog channel number. BTW, nice job ignoblegnome, Arduino rules.
Righto, so here seems a good
Righto, so here seems a good place to ask a few questions that are bugging me (not about penny, s/heâs lovely).
You use a SN754410NE -Â in the case of penny, is there any difference between the functionality of an h-bridge, and of a L293 motordriver?
By using robot-xâs shield, youâve cleaned up a lot of that wiring;Â I assume itâs possible to achieve a similar outcome if you customised a circuit board? So is it true that using robot-xâs board is a kind of multi-purpose re-wirer?
While Iâm at it, what is the difference between âshieldâ and âboardâ in this context?
Now you have the arduino shield/board and RXâs shield on penny, does that mean it will ALWAYS be on penny (as long as she lives)? or do you intend to later cannibalise her for parts - specifically the arduino and RXâs shield/board? (I donât have an arduino, and Iâm not sure what they give that isnât accessible from a picaxe, and they seem to be much less versatile-per-dollar. since youâve done both - whatâs your view?)
Â
Thanks for all the
Thanks for all the questions.
The SN754410NE is described as being pin for pin compatible with teh L293 driver. They are both h-bridges. The L293 includes internal clamp diodes, while Iâve heard that external clamp diodes are recommended for the SN754410NE (though Iâm not using any).
Ro-Bot-Xâs shield is just a custom board that happens to suit my needs. The term âshieldâ is an Arduino community term for a board that stacks onto an Arduino.
This is my first Arduino. I have futher plans for Penny, so sheâs safe for now. Weâll see what happens in the future.
I have found the Aruino to be more flexible than the Picaxe, and pretty easy to learn. Iâm playing with some navigation routines right now that require floating point math, which is something you canât do on the Picaxe.
Are those capacitors across
Are those capacitors across the motor terminals? What are they for?
The capacitors are used to
The capacitors are probably used to reduce electrical noises from the motors.
Yes, those caps are for
Yes, those caps are for reducing motor noise. You add 0.1 uF caps across the motor terminals. You can optionally add two more caps per motor. Each connects from one motor terminal to the metal case of the motor.
So theyâre not connecting
So theyâre not connecting terminal to terminal on the motors? Itâs kind of hard to see in the picturesâŠ
Thanks, BTW, for answering noob questions!
They are too
But yes they are connected terminal to terminal. As an extra measure, you could also connect additional capacitors. One from terminal A to the motor casing and another one from terminal B to the casing.
But usually you would do that only if the one capacitor seems insufficient.
I was just looking up motor noiseâŠ
So, Iâd thought Iâd post someones very pretty explanation (with diagrams)!
http://www.beam-wiki.org/wiki/Reducing_Motor_Noise Â
3 Strategies
Good
Better
Best
Ok, I understand now. Thanks!
Ok, I understand now. Thanks!
Challenge!
Hi ignoblegnome, would you consider the challenge of turning upside down the motor so the wheels are free enough to stand this robot up and create a âStart here self balancing robotâ?.
Â