Loading...
  Show Posts
Pages: 1 ... 247 248 [249] 250 251 ... 420
3721  Using Arduino / Programming Questions / Re: Button (INT0) interrupt freezes interrupts for 1 sec... stop! on: October 21, 2012, 07:11:08 pm
Except when I press the button (interrupts on INT0 to show the time)

If you use interrupts to be notified of the passage of time, then also using interrupts to do slow things like updating displays is probably a mistake. Especially if you have the interrupt configured to fire the interrupt handler repeatedly while the input remains active. I suggest you replace your button handling code with something that simply reads the state of the input at regular intervals.
3722  Using Arduino / Programming Questions / Re: Serial.available acting funny on: October 21, 2012, 07:08:03 pm
for some reason my serial.available is acting really funny, it wont print the line Serial.print("serial avail passed val: "); but it seems to be receiving data...in some way because I can see the serial monitor reacting to processing program when I run it. It seems that serial.available() is just not passing and returning 0 or null. any idea?

I can't make sense of that, probably because you are mistaken about what Serial.available() is supposed to do. Serial.available() doesn't print anything, does not receive data, does not pass or return anything written to or read from the stream.

What are you trying to do?
3723  Using Arduino / Project Guidance / Re: Astro sector drive - tilt sensors - accelerometers - GPS - compass on: October 21, 2012, 06:44:07 pm
I have looked at tilt sensors and accelerometers, GPS modules and compasses. I am a little confused about whether I should use a tilt sensor to measure the latitude setting of the unit - related to the GPS position, or an accelerometer.

The only purpose I can see for the the accelerometer is for leveling the device, and I don't see what latitude or GPS have to do with that.

All this problem seems to call for is an equatorial plane set to the current latitude and aligned with true North, and a spirit level. If you want it to be completely self-leveling, self-aligning and self adjusting then it would be possible to automate all that by using GPS to obtain latitude, dual axis accelerometer to measure horizontal alignment and compass to measure alignment with North. And then some sort of servo mechanism to adjust the level, alignment and elevation.

Like all the best geek projects, I expect you would spend more time creating an automated setup than you would ever have spent doing it manually. That's not a reason not to do it, of course. smiley
3724  Using Arduino / Programming Questions / Re: Sending different Post request to a Webserver on an Arduino on: October 21, 2012, 04:40:01 pm
I dont really know what u mean with this.

In that case there's a good chance that the page is incorrect. I suggest you load the page in a browser, use your browser's 'view page source' option to show the raw HTML and post that here (inside [ code ] [ /code ] tags).
3725  Using Arduino / Programming Questions / Re: Timer using millis() on: October 21, 2012, 04:38:19 pm
Code:
if((millis() - (minutes_240 + current_time_2)) >= 0)

That doesn't handle overflow correctly, although to be fair that would only be an issue if you're expecting to leave this running for weeks and weeks. Still, it's best to get into the habit of using a construct that handles overflow correctly:
Code:
if((millis() - current_time_2) >= minutes_240)

(I'm assuming here that current_time_2 is an unsigned long holding a previous value of millis(), and minutes_240 is an unsigned long that holds the required duration in milliseconds.)
3726  Using Arduino / Project Guidance / Re: Arduinos Wifi Shield to control two servos on: October 21, 2012, 04:29:50 pm
Presumably you've made some attempt to solve the problem yourself. Which part of it are you having trouble with?
3727  Using Arduino / Project Guidance / Re: Solenoid Purge/Test Button on: October 21, 2012, 04:28:23 pm
Not sure what you're trying to achieve, but it seems that you're proposing to connect an output pin to the 5V line. That would blow the pin's output driver when the output was set LOW.

3728  Using Arduino / Project Guidance / Re: Obtaining Magnetic Declination on: October 21, 2012, 04:22:01 pm
I have been working on a mobile project that needs to know the direction of true north.

The project I am interested in is a vehicle mounted solar tracker that will be used in Europe and northern Africa to keep our leisure batteries topped up.

I don't understand why you're trying to deal with magnetic declination and so on. It seems that the objective is to predict the position of the sun so you can point a solar collector at it. To do that you need to know the lat/log, time and direction of North. But just how accurately do you need to know which way is North? Or put another way, just how directional is your solar collector? If it's a flat PV panel, it's not very directional at all. Surely, a GPS position and time fix plus a bog standard uncorrected magnetic compass is going to get you better accuracy than you need. If you don't think it is, then what sort of accuracy are you aiming for, and why?

3729  Using Arduino / Programming Questions / Re: using raw hex for ir remote on: October 21, 2012, 01:28:09 pm
teach me how to convert raw hex into binary so that I can use it to control an NEC projector.

Probably, hex to binary is not what you actually need to achieve to solve your problem. What is your problem, exactly?
3730  Using Arduino / Programming Questions / Re: Running a motor until a button is triggered on: October 21, 2012, 12:12:25 pm
I don't see any need for an Arduino here. All you need is a self-energizing relay with a normally-closed momentary switch to de-energize it.
3731  Using Arduino / Project Guidance / Re: Robor car on: October 21, 2012, 12:08:24 pm
When i changed the channel, i also change the code.

I had really intended that you changed one thing at a time, i.e. switch the motor wiring over and show that the 'motor' control now operated the steering, then switch the pins over and show that the 'steering' control now operated the steering.  However, I gather you have proved that both motors work and that both channels of the motor shield work and that the commands to steer and drive can both make motors work.

When you say they only work one at a time, do you mean that in a given configuration one of the controls works perfectly and the other doesn't work at all? I'm puzzled by the implementation of the F/B/L/R/S commands, because they seem to be mutually exclusive. Moving forwards centers the steering; turning the steering stops forwards movement. Is that usable in practice? I'd have thought separate independent control of each channel was more useful, and I'm just wondering whether I've just mis-understood your description and this is your real problem.
3732  Using Arduino / Programming Questions / Re: Sending different Post request to a Webserver on an Arduino on: October 21, 2012, 09:47:52 am
It sounds as if the two cases are significantly different and not just doing the same thing to a different LED.

Is your web page actually submitting a URL request when you click the submit button? Obviously without that nothing will work. Are you using similar HTML for both forms? If one works the other should too, as long as you are submitting the right form and not mis-spelled the form name or anything like that.
3733  Using Arduino / Programming Questions / Re: Avoiding the void loop() on: October 21, 2012, 07:40:35 am
Imagine you wanted to run through a bunch of loops 100 times per second - accurately.

You could do this:

void loop(void)
{
     run_sub_1();
     run_sub_2();
     run_sub_3();
     delay(1000-constant);
}

You could do, but it would be a daft solution. The 'blink without delay' example sketch shows you exactly how to do things at regular intervals, there is no need to invent complicated interrupt-based scheduling solutions or use hacky fixed delay scheduling.
3734  Using Arduino / Programming Questions / Re: Simple Rfid Security System on: October 21, 2012, 07:30:20 am
"RFID Security" is a bit of a contradiction in terms.

There is really nothing about RFID that is secure. You can't rely on it to detect the presence or absence of anything, or to prove the identity of anything/anyone.
3735  Using Arduino / Programming Questions / Re: mapping values on: October 21, 2012, 07:27:52 am
Wow, even reading that description I have no idea what the picture was supposed to mean.

I guess that your system has two taps and two sensors. Each tap will be controlled by a servo. One sensor will be used to set the proportion of two liquid. The other sensor will be used to set the flow rate (or quantity - I'm not sure which) of the resulting mixture.

Is that the sort of thing you're trying to achieve?

By the way, you can't use % in a variable name. You could use the word percent (or some abbreviation) instead.
Pages: 1 ... 247 248 [249] 250 251 ... 420