Show Posts
Pages: 1 ... 247 248 [249] 250 251 ... 839
3721  Using Arduino / Programming Questions / Re: System Constants on: November 02, 2013, 10:14:01 pm
Where is this (the ARDUINO constant, how to find out which board is being used)  documented ?  I have found it explained nowhere.

I haven't seen it documented (apart from helpful posts like the one above, from people who have figured it out for themselves) but I don't think that's surprising - end users aren't expected to need to know how the internals of the Arduino IDE work so naturally it's not covered in the end user documentation.
3722  Using Arduino / Project Guidance / Re: Hey, need some help on where to start programming! (Balancing Bot) on: November 02, 2013, 10:09:35 pm
It looks as if somebody somewhere has defined millis() as a macro. That's not something the Arduino runtime does, and it seems like a strange thing for an Arduino library to do, but somewhere in the code being included directly or indirectly in your sketch that's being done.

I don't recognise ArduinoWrapper.h. What is it?
3723  Using Arduino / Programming Questions / Re: How to perform a ethernet request locally on: November 02, 2013, 09:28:28 pm
Before you try to do anything clever with the response, just print out what you are getting back to see whether it is what you expect.
3724  Using Arduino / Programming Questions / Re: Arduino Ethernet webserver page login. on: November 02, 2013, 09:16:48 pm
i have a userLoggedIn boolean variable, that is set to false at the start.
Then i have  a function to process every http request and checks if its asking for a web page, if it does, it then check if user is logged, if not, it presents the user the login.htm page.

It sounds as if you accept all client requests once any client has logged on i.e. you assume there is only ever one client at a time. It would be better to explicitly identify the client for each request and maintain a separate session status for each client.

Also, you can make that login process more user friendly by supporting a login on every page (i.e. by checking for login parameters being present if the session is not logged on) and design the login page so that it submits the same request that prompted you to return the login page. That means that if you request a page and haven't already logged in then you log in and then get the page you first requested. It also means that you can just URL-encode the login parameters on any request to get an auto-login.
3725  Using Arduino / Programming Questions / Re: Can't find strings in compiled sketch on: November 02, 2013, 09:06:08 pm
however Serial.print is never actually run, not that one anyway.

I'm not sure what you mean by this. I'm suggesting you make a change to your code so that it contains the data you want, and also prints it out in a form that I think you will find useful.
3726  Using Arduino / Programming Questions / Re: Code slows down with simple led on/off added on: November 02, 2013, 09:02:57 pm
The behaviour I get is that the led switch on and off in a random eratic delay.

I think you're saying that the LED is switching to the correct state but there is an unexpected erratic delay between sending the command, and the LED changing state.

The code handling the serial input looks fine so it makes sense that it is switching the LED correctly. I suspect that the problem is that the other code you are executing in loop() is taking a long time to complete so the serial port handling code is only running occasionally.

You could either read through the rest of the code carefully and look for places which could take a long time to execute, or add timing code to measure how long each part of the code takes to complete which would lead you to the hotspots.
3727  Using Arduino / Project Guidance / Re: Cable Counter on: November 02, 2013, 08:53:28 pm
Do you know any closer example code for review ?

Code to do what?

How you read the sensors will depend on what type of sensor you are going to use, but neither a rotary encoder nor a pair of reed switches would be difficult to read.
3728  Using Arduino / Project Guidance / Re: Digital or Analog inputs for DAQ ? on: November 02, 2013, 08:49:29 pm
That's a good starting point but it's lacking a lot of detail.

Quote
I need to record liquid level, temperature, valve position, heater status, level setpoint and temperature setpoint, and of course a time-stamp for each, so 6 inputs and a time stamp.

Where abouts are these data present in your system, and in what format? (I assume that some of these data will be present in multiple places in different formats.)
3729  Using Arduino / Project Guidance / Re: Quadcopter follows device. Howto? on: November 02, 2013, 08:44:08 pm
You need to find some way to find the relative bearing and distance to your target that doesn't involve electromagnetism.

If you can afford to have your target carry an optical beacon, you could detect it optically and determine the bearing. That would involve either some pretty shrewd electronics to detect an optical beacon, or enough processing power and memory to use a brute force technique such as image recognition and tracking. The Arduino isn't a good candidate for the latter. I suspect you will find that people before you have already solved the problem of having an Arduino detect the position of an IR beacon though.

I don't know how you would detect range. Perhaps you could have the beacon emit an ultrasonic range that the 'copter can detect when it is close to the target and use that to tell the 'copter to stop approaching?
3730  Using Arduino / Project Guidance / Re: Hey, need some help on where to start programming! (Balancing Bot) on: November 02, 2013, 08:37:55 pm
I don't know, because I'm not sure what code is being used or what the symptoms are now. All I know is:

Quote
Okay i fixed part of it. Now i get another smaller error which seems like an installation error.

error: macro "millis" passed 1 arguments, but takes just 0

The full error message would make it apparent which file caused this error and where in the file it was. It looks like a pretty obvious mistake i.e. calling millis() wrongly. It seems pretty unlikely that a fundamental mistake like this would have got published in a working library so I guess it's probably somewhere in the sketch, but we can only speculate.
3731  Using Arduino / Project Guidance / Re: Help Interfacing Futaba RC Receiver With Arduino Pro Mini on: November 02, 2013, 08:31:48 pm
The code looks as if it ought to work. Can you get access to a 'scope and see what signal is actually being received at the Arduino? It's conceivable the problem is eternal to the Arduino and it's giving you an accurate measurement of the pulse it's receiving.

If the problem turns out to be mis-reading by the Arduino then there are a few things you can try:

Wait for the serial port output to clear before you try to capture a pulse. By my reckoning 100 ms should just about be sufficient time, but as a sanity check you could try increasing it to e.g. 500 ms and see whether that affects the behaviour.

Assuming that the spurious results are relatively isolated, you could perform smoothing in software to reduce the effect. An exponentially decaying average is easy to code and would work well in this situation:
Code:
smoothed = (0.9 * smoothed) + (0.1 * newValue);
3732  Using Arduino / Programming Questions / Re: Can't find strings in compiled sketch on: November 02, 2013, 11:21:44 am
the spec calls for a version number and some other info embedded into the actual compiled code

I just call Serial.println(__FILE__ " " __DATE__ " " __TIME__) in setup so the sketch tells me what it is when it starts up. You could include hard-coded version information too if you wanted.
3733  Using Arduino / Programming Questions / Re: How to perform a ethernet request locally on: November 02, 2013, 11:18:10 am
My problem is now that I don't get the result on the serial monitor.

The serial output suggests you are able to connect and send the request.

Before you try to do anything clever with the response, just print out what you are getting back to see whether it is what you expect.
3734  Using Arduino / Project Guidance / Re: Hey, need some help on where to start programming! (Balancing Bot) on: November 02, 2013, 11:13:11 am
suspect you do not need #include <Wire.h> if you #include <I2Cdev.h> as the latter probably calls the former.

Because of the daft mucking-about that the Arduino IDE does with your code before building it, you need to explicitly #include in the .ino sketch file the header for every library that the sketch uses - even if it is not necessary in order to compile the .ino file. (The IDE uses the list of files #included in the .ino file to identify the libraries being used and hence what library source files to include in the build.)
3735  Using Arduino / Project Guidance / Re: Controlling Stepper Motor CW and CCW thru inputting the degrees using 4x4 Keypad on: November 02, 2013, 11:08:08 am
i need to make the stepper move in a specified position.
for example i pressed the numbers '2' and '8'( 28 degrees) and press the letter 'A' means enter/clockwise
the stepper will rotate at 28 degrees position..

I can guess that English is not your first language and it may not be easy to explain clearly what you want. If you mean that you enter '28#' and the stepper moves clockwise to the '28 degrees' position, and then you enter '20#' and the stepper moves counter-clockwise to the '20 degrees' position then your motor code is not correct; you would need to keep a record of the motor's current position, compare that with the desired new position read from the keypad, and that would tell you how far to move and in which direction.
Pages: 1 ... 247 248 [249] 250 251 ... 839