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

22  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.
23  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.
24  Using Arduino / Project Guidance / Re: Expand flash memory on Arduino on: September 27, 2012, 01:14:49 pm
Sorry about the mistake. That's what I thought, we might still be too slow.

We need the Arduino to measure various sensor values and sent to display.

Cannot be Android tablet as we may wanna output to different size LCDs from 7" to lets say 10".

Pi or similar would be good, but has to have a solid operating system so not to crash all the time. Also if this path is going to be taken, we need it to start up pretty fast (reason why we went with a micro-controller to start with). In addition, we don't want the users to see any start up text or GUI or anything. You turn the device on and bang it starts. Start up time can be 5-7 seconds though.

What you reckon?
25  Using Arduino / Project Guidance / Re: Expand flash memory on Arduino on: September 27, 2012, 12:45:53 pm
Library doesn't work with 115200 bps for some reason.
26  Using Arduino / Project Guidance / Re: Expand flash memory on Arduino on: September 27, 2012, 11:20:49 am
Yes I'm dumping graphics from the uSD.

When I wanna show an image and I call it, it gets drawn fro the top to the bottom and takes probably ~1 second for it to draw, need a faster time than that.



You have 300,000 pixels and write at 3840 bytes per second. I'm surprised you get it done in 1 seconds. I was expecting 10 seconds. You must be writing jpeg at large loss rate, but still the display itself is too slow than anything raw at more than 1 frame a second due to its serial connection. You want something fast, you need 8-16 or 32 bit wide bus at high speed.

Do you think it's the Arduino that's slow and not the actual 4DS module? Not that the images are stored on the uSD car on the module.
27  Using Arduino / Project Guidance / Re: Expand flash memory on Arduino on: September 27, 2012, 10:31:29 am
Pi was an example. Any low cost PC like would also be good.

I am a programmer so I Can sort out the programming on the pi/PC side with Java.

Arduino has button and some sensors. So it's needed.

Thanks.
28  Using Arduino / Project Guidance / Re: Expand flash memory on Arduino on: September 27, 2012, 09:34:48 am
Imagine it was 4DS that was slow. Is it advisable to go with a system by connecting Arduino to a Raspberry pie like platform? Have Arduino handle the control sides of things and send data to the pie to show as graphics? Is it even possible?

Thanks.
29  Using Arduino / Project Guidance / Re: Expand flash memory on Arduino on: September 27, 2012, 08:46:33 am
Yes I'm dumping graphics from the uSD.

When I wanna show an image and I call it, it gets drawn fro the top to the bottom and takes probably ~1 second for it to draw, need a faster time than that.

30  Using Arduino / Project Guidance / Re: Expand flash memory on Arduino on: September 27, 2012, 08:37:54 am
Quote
This meant each image took 15 lines of code. So imagine if I had 100 images that'd be 1500 lines of code!
I don't understand this but if you've fixed it then good.

As for the speed, do you know where the bottleneck is, you could add an ARM50 and find that it's the serial connection or even the 4DS processor.

Have you done the maths, now many bytes have to be transferred to redraw a screen? What baud rate are you using?

_____
Rob

Not sure how many bytes. The screen is 640 x 480 pixels. I am on 38400 bps baudrate. I have contacted the person who wrote the library also to see if he has tested with ChipKit or not and what the results are.

Thanks.
Pages: 1 [2] 3 4 ... 16