Show Posts
Pages: 1 [2] 3 4 ... 17
16  Using Arduino / Programming Questions / Re: ethernetshield ip address retriving on: May 15, 2013, 02:49:08 pm
The external IP shouldn't matter to the Arduino, you need the default gateway so that the Arduino knows where to send external requests.
17  Using Arduino / Programming Questions / Re: Newbie here!! Starting a loop while its still finishing? on: May 15, 2013, 01:35:59 pm
I'm not sure I understand what you are asking here. The time between calls to loop will be tiny (a few clock cycles so just a few microseconds).
While I appreciate you want to work it out for yourself a bit, some more clarity would be needed to allow us to point you in the right direction.
18  Using Arduino / Programming Questions / Re: Web server, How to make a simple button to reset a counter?? on: May 15, 2013, 12:05:06 pm
Please post your code.
19  Using Arduino / Programming Questions / Re: ethernetshield ip address retriving on: May 15, 2013, 11:39:02 am
2.29.30.0 is not a valid default gateway, it will be in the ranges:
   10.0.0.0        -   10.255.255.255
   172.16.0.0      -   172.31.255.255
   192.168.0.0     -   192.168.255.255
As these are the only ranges that are reserved for private/local networks. On your PC, when connected to the network bring up a command prompt and type in
Code:
ipconfig /all
This will give you information on all of the network cards active in your computer. Find your connection in the list and read off the Default Gateway address from there.
20  Using Arduino / Programming Questions / Re: Problem with files on: May 15, 2013, 06:57:40 am
You probably need to include the SPI and Wire libraries in your main sketch file.
21  Using Arduino / Programming Questions / Re: ethernetshield ip address retriving on: May 15, 2013, 06:56:43 am
The default gateway will be the IP address of your router. For 99% of cases it will be the same as the IP address of the Arduino (if you've configured it correctly) with the last byte changed to a 1:
e.g. Arduino IP: 192.168.0.5 => Default Gateway: 192.168.0.1
22  Using Arduino / Programming Questions / Re: TEA encryption algorithm test vector on: May 15, 2013, 02:06:11 am
Firstly 0xgf12hd11 is not a valid unsigned char value, they should be two hex digits.

What do you mean by your RF module sending 8 bit packets where only 4 are data?? Do you have a data sheet? Have you tested just sending a string between the two arduinos.
23  Using Arduino / Programming Questions / Re: Serial Flow Control (Handshaking) on: May 14, 2013, 12:41:37 pm
The source you've attached doesn't seem to implement either of the changes I suggested. If it still isn't working I would try a different terminal program, or even better, build your own specific application to do this.
24  Using Arduino / Programming Questions / Re: Serial Flow Control (Handshaking) on: May 14, 2013, 10:46:01 am
I think the problem is that when you are sending your XONs repeatedly, the first 64 (I think) fill up the serial tx buffer, so while they are being sent the Serial.write function blocks the processor until there's space in the buffer for the next character. When you receive a character it tries to send the XOFF, but the tx buffer is still full with the XONs, so it will have to wait for all of these to be sent before the XOFF actually gets sent. Because your PC hasn't received the XOFF yet it will still be sending characters, and I'm sure it will be no surprise that it takes just as long to fill up the rx buffer as it takes to empty the tx buffer. You then are only reading one character from the rx buffer, and the loop starts again, the tx buffer fills up (this will probably happen faster than the processor can even send a single byte), however this time because the rx buffer is already full (only one character was read out of it last time) the old data gets written over and lost.

The main thing I think you need to fix is that you should only send an XON every few seconds, to stop the Tx buffer filling up (don't use delay though, look at blink without delay for how to do this properly). Also in your parsing section read all of the data, not just a single character. Now that I look at it I think you may indirectly do this anyway, but I would add a command buffer in your code and you can keep filling with the serial data until you get a command, then send the XOFF, process it, send an XON etc.
25  Using Arduino / Programming Questions / Re: Serial Flow Control (Handshaking) on: May 14, 2013, 09:02:37 am
What's sending the commands to the Arduino? That will need to be adapted to wait until the Arduino is ready for the next command. In principle though what you have suggested should be workable.
26  Using Arduino / Programming Questions / Re: TEA encryption algorithm test vector on: May 14, 2013, 08:49:04 am
I don't know what more you need to know. I've given you enough information to at least make a stab at building something, I know you want your whole program written out for you to copy&paste, but I'm not going to do that, you won't learn anything and when it inevitably doesn't quite work we'll be in no better position than we are at the moment. I'm happy to answer any (specific) questions you have, but you should have a go at building it, it would be a good exercise in understanding how pointers work and understanding how to work with c style strings properly.
27  Using Arduino / Programming Questions / Re: Force Concatenation Order for Multiple File Sketches on: May 14, 2013, 02:19:52 am
You could make the second sketch file the main file, and the one with loop and setup the secondary one, rename your folder to the same name as the second file; but bother? If you're going to split your code across multiple files you might as well do it properly.
28  Using Arduino / Programming Questions / Re: Force Concatenation Order for Multiple File Sketches on: May 14, 2013, 01:48:11 am
You need a header file for sharing functions with the second file, which defines all of the functions prototypes, and include that at the top of your main sketch:
Main sketch
Code:
#include "myLib.h"

int* p_x;

void setup(){
   p_x=get_p_x();
}

void loop(){
  Serial.print(myFunc(*x,1));
}
myLib.h
Code:
#ifndef MY_LIB_H
#define MY_LIB_H

int* get_p_x(void);
int myFunc(int a,int b);

#endif
myLib.cpp
Code:
#include "myLib.h"

int x=0;

int* get_p_x(void){
   return &x;
}

int myFunc(int a,int b){
   return a+b;
}

To share variables you need to either make them global with extern (quicker to implement, but not good practice and likely to cause problems down the line) or use pointers and have accessor functions to pass the variable between the files (like I did in the example to share x between the two files).
29  Using Arduino / Programming Questions / Re: New to Arduino - Need advice with a project... on: May 14, 2013, 01:08:28 am
An HTTP POST request is made up from a set of request headers, and the request body.
Content-Type tells the server the format of the request body, application/x-www-form-urlencoded means the data is a set of name=value pairs serparated by '&' and is the format web browsers send when submitting html forms.
Content-Length tells the server how long the request body is.
The x=hello&y=world is the request body, here I just did an example for sending two parameters, one called x with the value "hello", the second called y with the value "world".
30  Using Arduino / Programming Questions / Re: Force Concatenation Order for Multiple File Sketches on: May 14, 2013, 12:59:25 am
Post your code, otherwise we are guessing at the problem
Pages: 1 [2] 3 4 ... 17