Show Posts
Pages: 1 2 [3] 4 5 ... 17
31  Topics / Science and Measurement / Re: Frequency Counter Library on: December 01, 2012, 05:01:53 pm
I am using this:
http://interface.khm.de/index.php/lab/experiments/frequency-measurement-library/

Are we talking about the same library? Is the above library in the link able to detect zero RPM and speed?

This is the hall effect sensor we use:  http://www.digital-speedos.co.uk/hall-effect-speed-sensor-for-drift-gauges-non-magnetic-382-p.asp
32  Topics / Science and Measurement / Re: Frequency Counter Library on: December 01, 2012, 12:17:43 pm
Been using the Frequency Measurement Library, it's great. Been using it to measure the speed and RPM on my car. Is there a way of measuring 0 frequency to show 0 speed or 0 RPM at all?

Thanks.
33  Using Arduino / Programming Questions / Re: How to send numbers from one Arduino to another using Serial on: November 27, 2012, 04:44:21 pm
Managed to get it working, thanks.
34  Using Arduino / Programming Questions / Re: How to send numbers from one Arduino to another using Serial on: November 27, 2012, 08:09:31 am
This works beautifully thanks.

However if I have a set of extra data to also send via another serial port (Serial 3) to a device using a Bluetooth module, then I get missing data again.

So I receive the _rpm from first Arduino to my second Arduino Mega, then I send _rpm with 3 more data to Serial3 and receive these on my phone, the _rpm data is sometimes missing as before
35  Using Arduino / Programming Questions / Re: How to send numbers from one Arduino to another using Serial on: November 26, 2012, 04:11:36 pm
Quote
As PaulS said, you are printing _rpm before it arrives. That's why I made a function processNumber. You are supposed to print it from there, when it has totally arrived. Why are you changing a method that works, to one that doesn't?
That's what I thought initially. But, in processNumber, he's copying the value to _rpm, rather than printing it. Since processNumber doesn't get called until the > arrives, copying the value in processNumber should be OK.

Exactly, I print it after it has arrived and setting _rpm within processNumber.
36  Using Arduino / Programming Questions / Re: How to send numbers from one Arduino to another using Serial on: November 26, 2012, 11:52:04 am
When I do it this way:

Code:
const char startOfNumberDelimiter = '<';
const char endOfNumberDelimiter   = '>';

long _rpm = 0;


void setup ()
  {
  Serial.begin (115200);
  Serial2.begin (115200);
  Serial3.begin (115200);
 
   pinMode(8, INPUT); 
  } // end of setup
 
void processNumber (const long n)
  {
      Serial.println(n);
  }  // end of processNumber
 
void processInput ()
  {
  static long receivedNumber = 0;
  static boolean negative = false;
 
  byte c = Serial2.read ();
   
  switch (c)
    {
     
    case endOfNumberDelimiter: 
      if (negative)
        processNumber (- receivedNumber);
      else
        processNumber (receivedNumber);

    // fall through to start a new number
    case startOfNumberDelimiter:
      receivedNumber = 0;
      negative = false;
      break;
     
    case '0' ... '9':
      receivedNumber *= 10;
      receivedNumber += c - '0';

      break;
     
    case '-':
      negative = true;
      break;       
     
    } // end of switch 
  }  // end of processInput
 
void loop ()
  {
       

        if (Serial2.available ())
        {
          processInput ();
        }
 
  }

the output I get from the second Arduino on the Serial Monitor is correct. So when I send <8000> from the 1st Arduino I get 8000 on the Serial Monitor of the 2nd Arduino.

When I do send <8000> this way from the 1st Arduino however,

Code:
const char startOfNumberDelimiter = '<';
const char endOfNumberDelimiter   = '>';

long _rpm = 0;


void setup ()
  {
  Serial.begin (115200);
  Serial2.begin (115200);
  Serial3.begin (115200);
 
   pinMode(8, INPUT); 
  } // end of setup
 
void processNumber (const long n)
  {
     _rpm = n;
  }  // end of processNumber
 
void processInput ()
  {
  static long receivedNumber = 0;
  static boolean negative = false;
 
  byte c = Serial2.read ();
   
  switch (c)
    {
     
    case endOfNumberDelimiter: 
      if (negative)
        processNumber (- receivedNumber);
      else
        processNumber (receivedNumber);

    // fall through to start a new number
    case startOfNumberDelimiter:
      receivedNumber = 0;
      negative = false;
      break;
     
    case '0' ... '9':
      receivedNumber *= 10;
      receivedNumber += c - '0';

      break;
     
    case '-':
      negative = true;
      break;       
     
    } // end of switch 
  }  // end of processInput
 
void loop ()
  {
       

        if (Serial2.available ())
        {
          processInput ();
        }
                       
       Serial.println(_rpm);

  }


then I don't get the correct values, sometimes I get 800, sometimes 80 sometimes 8 etc.

Hope this is more clear.
37  Using Arduino / Programming Questions / Re: How to send numbers from one Arduino to another using Serial on: November 26, 2012, 11:22:26 am
When it's done the original way when I stream lets say the number 8000 it gets there as 8000. However when I use my code it's sometimes 800, sometimes 80 or even 8.

38  Using Arduino / Programming Questions / Re: How to send numbers from one Arduino to another using Serial on: November 26, 2012, 06:54:29 am
Sorry to bump up this thread:  I have used this and works pretty well.

I only send 1 piece of data from one Arduino to another. First Arduino gathers data and sends it to a second Arduino that received this piece of data. What I'd like to do is to set the received data to a variable. Then re-use it in my "Loop".

Code I am using in my receiving part is this, but doesn't work as expected:-

Code:

const char startOfNumberDelimiter = '<';
const char endOfNumberDelimiter   = '>';

long _r = 0;

void setup ()
  {
  Serial.begin (115200);
  Serial2.begin (115200);
  Serial3.begin (115200);
 
   pinMode(8, INPUT); 
  } // end of setup
 
void processNumber (const long n)
  {
      _r = n;

  }  // end of processNumber
 
void processInput ()
  {
  static long receivedNumber = 0;
  static boolean negative = false;
 
  byte c = Serial2.read ();
 
  switch (c)
    {
     
    case endOfNumberDelimiter: 
      if (negative)
        processNumber (- receivedNumber);
      else
        processNumber (receivedNumber);

    // fall through to start a new number
    case startOfNumberDelimiter:
      receivedNumber = 0;
      negative = false;
      break;
     
    case '0' ... '9':
      receivedNumber *= 10;
      receivedNumber += c - '0';
      break;
     
    case '-':
      negative = true;
      break;
     
    } // end of switch 
  }  // end of processInput
 
void loop ()
  {
       
        if (Serial2.available ())
        {
          processInput ();
        }
                       
        Serial.println(_r);
 
  }


Any help is appreciated.
39  Using Arduino / General Electronics / Re: Frequency Measurement Library Noise on: November 16, 2012, 01:26:49 pm
BUMP
40  Using Arduino / Project Guidance / Masking parts of an LCD with software on: October 12, 2012, 02:44:39 pm
Hi everyone.

I have a 7" LCD which has a VGA and a RCA input.

It's going to go to in my car eventually. The RCA input will be connected to a reverse camera. I need to make something up to go between the RCA input and the reverse camera to mask (in black) parts of this input. So when you get a square picture of whatever's behind your car, I need some of it to be masked in black.

Is there a device or way of doing this at all?

Thanks. 
41  Using Arduino / General Electronics / Re: Frequency Measurement Library Noise on: October 10, 2012, 06:18:34 am
Thanks again.

Another question while we're at it.

When connected to my car's speed signal, it measures the frequency spot on, however when var is stationary (zero speed) either it measures random values or nothing.

 Is there a way of measuring zero frequency?
42  Using Arduino / General Electronics / Re: Frequency Measurement Library Noise on: October 08, 2012, 01:04:37 pm
Worked like a charm. Thanks man!
43  Using Arduino / General Electronics / Re: Frequency Measurement Library Noise on: October 08, 2012, 11:46:58 am
The range of frequency I am trying to measure in from 0 to about 500 Hz.

@Docedison, unfortunately I have no idea what to do exactly. This pull up resistor, where does it need to go?

44  Using Arduino / General Electronics / Frequency Measurement Library Noise on: October 08, 2012, 09:42:02 am
Hi,

Currently I am making use of this library and circuit to measure the frequency:-
http://interface.khm.de/index.php/lab/experiments/frequency-measurement-library/

However when I put my hand close to the circuit, I get fluctuations from the frequency readings. So I'm guessing I introduce noise some how? How can this be solved?

Thanks.
45  Using Arduino / Project Guidance / Re: Expand flash memory on Arduino on: September 27, 2012, 02:09:21 pm
Arduino DUE looks good, but I can't wait for it to come out.
Pages: 1 2 [3] 4 5 ... 17