Show Posts
Pages: 1 [2] 3 4 ... 844
16  Using Arduino / Project Guidance / Re: Having Arduino and Gobetwino wait for eachother to continue on: August 06, 2014, 09:56:48 am
As a test, could you try sending the sequence up to the {enter} key, and then send the {enter} key separately? For example you could modify the sketch so that it sends the first part on the first button press, and the second part on the second press.

I'm wondering whether either the {enter} is arriving too soon, before the dialog has opened and taken the keyboard focus, or that the key press you're sending is not what the dialog requires (an enter versus return issue, or something like that).
17  Using Arduino / Programming Questions / Re: Handle millis()/micros() overflow in task manager on: August 06, 2014, 09:22:25 am
To me it is quite clear that when you are close to the overflow point of the unsigned value space, the regular "subtract" approach will not work even if you know that one variable will be less (further in the past) than another.

To me it is quite clear that you don't understand how unsigned arithmetic works. Using unsigned arithmetic and subtraction handles the rollover case correctly without needing any special code if you code it correctly.

If you subtract a previous time from the current time using unsigned arithmetic the result is the elapsed time.

Code: (declarations)
unsigned long previousMillis;
unsigned long interval;

Code:
if(millis() - previousMillis >= interval)
{
    // the interval has elapsed
    previousMillis += interval; // note the start of the next interval
}

We will need to either involve a third variable, or cast as signed.

No, and no. The times you hold are times in the past. Subtract that from the current time to calculate the elapsed time. The elapsed time is always positive. Working out when the elapsed time exceeds a threshold is then trivial.
18  Using Arduino / Programming Questions / Re: Timers, PWMs and servos on: August 06, 2014, 09:12:34 am
So I assumed it was ok...

The problem is you're trying to use the same timers for multiple things.

Quote
I didn't want this function to be in the regular loop and waste CPU time so I wanted to just call it every 0,5seconds.

That logic is flawed. You certainly don't need interrupts just to refresh a display twice a second, and your justification of not "wasting" CPU time is completely wrong. You've saved a negligible amount of CPU time but made your sketch considerably more complex and squandered one of your hardware timers for no good reason. If you want to refresh the display twice a second, put code in loop() to do that - don't muck about with timers and interrupts.
19  Using Arduino / Project Guidance / Re: reading 10 incremental rotary encoder with one Arduino Due on: August 06, 2014, 09:06:55 am
is this possible? any other solutions?

Calculate the signal frequency you need to support. Then decide what you need to do with the data you're collecting. Are you just counting pulses, or something more?
20  Using Arduino / Project Guidance / Re: Arduino servo control for large number of servos on: August 06, 2014, 08:12:25 am
It's a pita just to install opencv, and I'm not the only one who is confounded by it.

What platform are you trying to install it on?

Trying to put it on a mac with mavericks.

Not familiar with that platform, but I see there is a binary for Linux/Mac - doesn't that work? If not, there seem to be a few tutorials about such as http://mac-opencv-projects.blogspot.co.uk/2014/01/installing-opencv-on-mac-os-x-1091.html

I'm afraid it seems to be the norm for open source software to have multiple pre-requisites and for the documentation to be patchy and out of date - although opencv may seem to be a pita to install, it's better than many.
21  Using Arduino / Programming Questions / Re: Handle millis()/micros() overflow in task manager on: August 06, 2014, 08:04:42 am
Some extra checking is needed.

Not if you code it correctly - using unsigned arithmetic and using subtraction rather than addition.
22  Using Arduino / Project Guidance / Re: Robot? on: August 06, 2014, 08:01:54 am
Decide what range of movement, speed and force/torque you want and especially what your requirements are for holding position against a sustained load, and whether you have any power/weight/size constraints. Stepper motors have their advantages, but tend to be relatively heavy and not particularly efficient - it may be that a different type of motor would be more suitable for your application.
23  Using Arduino / Programming Questions / Re: Handle millis()/micros() overflow in task manager on: August 06, 2014, 06:13:30 am
Seems like a great justification for just using the simple Blink Without Delay technique and not wasting time on complex task managers.

Yes.
24  Using Arduino / Project Guidance / Re: Third Year Project (first post). on: August 06, 2014, 06:07:03 am
my dads has been going on about relays and transistors and I'm slightly confused

If he is trying to teach you how to use them, and if you're interested in learning, then I suggest you pay attention to him since it'll be far easier to learn from somebody there next to you rather than a bunch of strangers writing stuff over the internet.
25  Using Arduino / Project Guidance / Re: Having Arduino and Gobetwino wait for eachother to continue on: August 06, 2014, 06:03:53 am
What sequence of key strokes is the sketch intended to send?

What is intended to happen to your spreadsheet application when you send this sequence?

What is actually happening?
26  Using Arduino / Project Guidance / Re: Trying to source strong (and cheap) electromagnets on: August 06, 2014, 06:00:40 am
A ferromagnetic core will increase the field strength by increasing the magnetic permeability of the core (compared to an air core). Solenoids and rail guns use air cores because there's a fundamental requirement for the core to be hollow so that something can pass through it - since you don't have that requirement here, a ferromagnetic core would be better.
27  Community / Exhibition / Gallery / Re: Arduino Simulation Computer Keyboard on: August 06, 2014, 05:53:05 am
This tutorial, shows how to press a key to trigger an input “HELLO WORLD” into your computer screen via the simulation computer keyboard.

It seems somewhat redundant since there are several Arduino tutorials showing how to send keyboard and mouse events from an Arduino without requiring your non-standard hardware. Your post seems to be a thinly veiled advert for that other site you linked to. Did you have a question relating to Arduino?
28  Using Arduino / Project Guidance / Re: Viability and General Approach For Automated Dry Ingredient Dispenser on: August 06, 2014, 05:49:41 am
I'm thinking a hopper full of one (or all) ingredient sitting above a "drawer". When the drawer is closed it fills itself with the ingredient that falls from the hopper above it. The drawer has no bottom, but is sitting on a surface that makes the seal. The drawer also has a protruding surface on the top of it to close the hopper as the drawer is opened. As it is opened the ingredients fall out of the bottom.
The amount of ingredient dispensed is regulated by the size of the drawer.

I've seen some brick/block manufacturing equipment that works on this principle, and it seems to be simple, reliable and consistently accurate.
29  Using Arduino / Project Guidance / Re: High accuracy servo, various component selection on: August 06, 2014, 05:47:39 am
If you can stay away from safety critical issues and long term durability, I would have thought that most servos would be able to achieve a resolution of around a degree. Digital servos are faster and better at holding position if you need to apply a sustained torque but I doubt you need that here from your description.

In my opinion the 'mark 2' version designed for long term use would be better using a geared DC motor with a rotary encoder on the final drive - this will eliminate problems due to wear on the pot and drive mechanisms. However it will be more expensive and harder to get working.

If the system is safety critical then you need to address the possible failure modes and resulting liability issues, and I'm not going to tell you how to do that.
30  Using Arduino / Project Guidance / Re: Communication between SD HTML webserver and arduino on: August 06, 2014, 05:34:54 am
The buttons in the web page need to trigger an HTTP request to the web server. There are lots of ways to do that in HTML - for example you could use hyperlinks, or include a form with some buttons in.

The Arduino needs to retrieve the URL path and parameters from the incoming request. Exactly how it does that will depend on how the request and related parameters are encoded in your HTTP request, which will be determined by your HTML page. There are lots of examples showing how to retrieve the request URL from the incoming request - almost every web server does this one way or another.
Pages: 1 [2] 3 4 ... 844