Show Posts
Pages: 1 [2] 3 4 ... 16
16  Using Arduino / General Electronics / Re: Frequency Measurement Library Zero Frequency on: December 03, 2012, 07:45:49 am
Thanks for your reply.

I'm not sure how to do that to be honest  smiley-confuse
17  Using Arduino / General Electronics / Frequency Measurement Library Zero Frequency on: December 03, 2012, 05:41:38 am
I am using the Frequency Measurement Library: http://interface.khm.de/index.php/lab/experiments/frequency-measurement-library/

I am trying to measure frequecy from 0-500 To then connect to my RPM and speed frequency signal wires on my car to convert the frequency values to the correct speed and RPM values.

The problem I have is that when RPM is 0 or speed is 0 the library either doesn't give me anything or gives random values. How can I measure 0 frequency? Or in other words set frequency at zero when there are no counts?

I don't have to use this particular library either.

Any help is appreciated.

Thanks.
18  Topics / Science and Measurement / Re: Frequency Counter Library on: December 02, 2012, 05:21:16 am
How can I do this with a car? Especially the engine rpm?
19  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
20  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.
21  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.
22  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
23  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.
24  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.
25  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.

26  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.
27  Using Arduino / General Electronics / Re: Frequency Measurement Library Noise on: November 16, 2012, 01:26:49 pm
BUMP
28  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. 
29  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?
30  Using Arduino / General Electronics / Re: Frequency Measurement Library Noise on: October 08, 2012, 01:04:37 pm
Worked like a charm. Thanks man!
Pages: 1 [2] 3 4 ... 16