Show Posts
Pages: 1 2 3 [4] 5 6 ... 324
46  Using Arduino / Programming Questions / Re: Speed of two DC motors on: September 16, 2014, 06:46:16 am
We've discussed this before: the two motors will almost certainly not run at the same speed, so why should the encoders be the same. You should accept that fact. The whole point of encoders, as already pointed out to you at the weekend, is to see the difference in motor speeds so you can speed one up or slow one down to get the vehicle moving straight. When moving straight, the pwm values will very likely differ from one side to the other, because the motors and gearboxes are different.

You posted results the other day that showed the speeds were in fact pretty close, identical in some cases.

Someone gave you an answer about those huge 20-million or whatever it was, encoder readings.

The only way to see if the encoders agree is to put both encoders on the same wheel at the same time, or at least at different times but with the same pwm value and see if the encoder readings are the same. Then when you know the encoders agree, when they are on their actual wheels you can accept their values and if one wheel goes faster than the other at same pwm, well that's the way of it. Adjust one wheel's pwm until their encoders agree, even if the pwms are then different.
47  Using Arduino / Programming Questions / Re: Speed of two DC motors on: September 16, 2014, 04:34:18 am
But you've got code for this haven't you? You gave results a few days ago.

What does this mean though:

Quote
had two encoders

..... Do they no longer have encoders? Have you changed the hardware?
48  Topics / Robotics / Re: Connecting Arduino to Servos and Rotary Switch on: September 16, 2014, 04:28:24 am
Green dots are wires that connect; no dot means just crossed over in the drawing and not connected to each other.
49  Using Arduino / Project Guidance / Re: Start Arduino IDE with specific com and project on: September 16, 2014, 03:53:00 am
Well you could ensure the right code by opening the IDE with a double-click on the .ino rather than from the IDE icon.

Not sure about the com port thing, though.
50  Using Arduino / General Electronics / Re: Soldering problem on: September 16, 2014, 03:25:37 am
At last a real use of a Pink Pearl eraser! They're certainly bloody useless at rubbing out pencil on paper, that's for sure. Pink Smudge, more like.
51  Using Arduino / Programming Questions / Re: millis(), timings, timer on: September 16, 2014, 03:13:16 am
Code:
if (b1 == 0)  
  timing1 = (time + timer1);  
    (digitalWrite(led, HIGH));  // <<<<<<<<<<<<<<<<<<<<< meant to be part of the "if"?

If you mean that the digitalWrite is part of the "if" then you need add braces otherwise only the first line is part of the "if" and the second will always run

Code:
if (b1 == 0)  
{
  timing1 = (time + timer1);  
    (digitalWrite(led, HIGH));
}
52  Using Arduino / Programming Questions / Re: Code error on: September 16, 2014, 03:00:55 am
It would be nice if there was a "library name issuing authority" so that names aren't duplicated. Or at least a naming convention eg to use author's initials or name so that we would know button_jim.h is not the same as button_fred.h.
53  Using Arduino / Project Guidance / Re: Suitable arduino for home automation system on: September 16, 2014, 02:55:13 am
I'm not talking about the uC chip, I'm talking about the Arduino card. Maybe in his case a Uno won't have enough pins and it might be waste of money if he later has to upgrade to a Mega, say. My real point is, engineering design is about understanding requirements before proposing a solution.

And if....

Quote
helped students for a payout

... means that you get paid by students to do their work for them, then there is very definitely something wrong with that. I will take that opinion to my grave.

54  Using Arduino / Project Guidance / Re: Suitable arduino for home automation system on: September 16, 2014, 02:38:19 am
Well go with an UNO

You must have inside information as to the number and type of sensors and actuators and therefore the number of pins required.

Quote
helped students for a payout

Does that mean what I think it means?
55  Using Arduino / Programming Questions / Re: Using RTC (DS1307) to trigger 4 events throughout the day on: September 16, 2014, 02:10:33 am
I advocate the use of the alarm library and it is indeed worth understanding, as cattledog says.

But before I embraced that library, I did it old school.... I wanted to write the temperature to eeprom at 15 minutes past every hour. So all you do is look to see if tm.minute==15 in loop(). BUT there's a trick.... since loop runs at something like 150k times a second, tm.minute will be 15 for many many passes, and you only want one eeprom write. So have a flag, say eepromWritten, initially false, and set it true the first time you write the eeprom on a new quarter past the hour. Then no matter how many times you loop(), only one eeprom write will happen for that hour. Further trick is to remember to set it false again, the first time you get a tm.minute of 16 (or strictly, not 15), else it won't write in an hour's time.

Snippet below using flag called tempLogged.... but it's pretty clear the library makes things lots simpler for the coder.

Code:
 if (tm.Minute==15)
  {
    if  (tempLogged == false)  //declare this first of course :)
    {
      // do stuff
      tempLogged = true;
    }
  }


  if (tm.Minute!=15)
  {
    tempLogged = false;
    }
    
56  Using Arduino / Programming Questions / Re: how do I get information on using libraries on: September 16, 2014, 01:54:27 am
Does anyone know of somewhere that teaches the use of libraries?

I think this is probably as good as you'll find.

Quote
I am referring to is the matrix library in the arduino software i.e. maxmatrix

It's certainly not in my virgin libraries folder with 105r2

57  Using Arduino / Sensors / Re: NewPing code debugging on: September 16, 2014, 01:24:32 am
Do you have the NewPing library installed?
58  Using Arduino / Project Guidance / Re: need programming help on: September 16, 2014, 12:30:19 am
@mart, bad form to edit and not highlight the == edit since that makes my post redundant and me look like a pillock.

edit... but main thing is of course that the OP's question is answered.
59  Using Arduino / Project Guidance / Re: need programming help on: September 16, 2014, 12:26:28 am
Hi and welcome...

For a start you need this....

Code:
if (buttonPin = HIGH)

.... to be this:

Code:
if (buttonPin == HIGH)

Read the "warning" section here.

edit.... along with what mart said  smiley-cool

Also, please use code tags like mart did, makes it muuuuch easier to read code that way.

(The # icon above the  smiley-wink smiley-sweat)
60  Using Arduino / Project Guidance / Re: Suitable arduino for home automation system on: September 16, 2014, 12:22:41 am
All will work

Hmmmmmm... Maybe (and I repeat, maybe) but if you need loads of pins for a lot of sensors and motors, using an Uno might be very difficult compared to say a Mega, requiring external chips for multiplexing and so on.
Pages: 1 2 3 [4] 5 6 ... 324