Show Posts
Pages: [1]
1  Forum 2005-2010 (read only) / Syntax & Programs / Accessing stdlib functions on: November 05, 2008, 12:41:41 pm
I am a noob to the Arduino, but not to C. I was attempting to use the floatToString function (see playground), but it bombs on the itoa() function, which is in the stdlib.

I tried a "#include <stdlib.h>" but that doesn't work.

So what do I need to do to use this function? :-?
2  Forum 2005-2010 (read only) / Development / Problems getting started on: November 18, 2008, 01:23:57 pm
I started this out as a struct, but had some memory problems, so I went to creating a library.

I am keeping this a simple as possible until I find the problems.

In the following code, I am unable to compile with the following errors:

Mash.cpp:6: error: new types may not be defined in a return type
Mash.cpp:6: note: (perhaps a semicolon is missing after the definition of 'MashS
tep')
Mash.cpp:6: error: return type specification for constructor invalid
In file included from v:/arduino-0012-win/arduino-0012/hardware/tools/avr/lib/gc
c/../../avr/include/stdlib.h:47,

                 from V:\arduino-0012-win\arduino-0012\hardware\cores\arduino/WP
rogram.h:4,

v:\arduino-0012-win\arduino-0012\hardware\tools\avr\bin\../lib/gcc/avr/4.3.0/inc
lude/stddef.h:214: error: two or more data types in declaration of 'size_t'

In file included from V:\arduino-0012-win\arduino-0012\hardware\cores\arduino/WP
rogram.h:4,


Here is the code. This is too simple to have these problems:
MashStep.h
Code:
#ifndef MashStep_h
#define MashStep_h

#include "WConstants.h"

class MashStep
{
public:
            MashStep();
private:

}
#endif

MashStep.cpp
Code:
//#include "WProgram.h"

#include "MashStep.h"


MashStep::MashStep(){}


sketch :
Code:
#include <MashStep.h>
void setup() { }
void loop() { }

Any ideas ? This is my first voyage into Arduino programming.
3  Forum 2005-2010 (read only) / Interfacing / Re: Simple Motor Question on: May 19, 2009, 08:22:08 am
Ok, so I think that at least for a prototype, the RC servos are easiest.

The "cup" that I need to dump weights about 60g, the servo would be mounted on the side, near the CG. Initial thoughts are that I would turn the cup directly, but maybe a gear or lever would be more cost effective. The "dump" would be about 120*.

Anyone care to point me to where I can find out (learn) how much torque would be required ?  Those 56g motors are pricy.
4  Forum 2005-2010 (read only) / Interfacing / Re: Simple Motor Question on: May 18, 2009, 04:15:25 pm
I was looking at the Motor Shield
5  Forum 2005-2010 (read only) / Interfacing / Re: Simple Motor Question on: May 18, 2009, 03:27:44 pm
AWESOME ! You just made my day! ;D
6  Forum 2005-2010 (read only) / Interfacing / Re: Simple Motor Question on: May 18, 2009, 02:59:22 pm
R/C Servos? Can you drive more than 2?
7  Forum 2005-2010 (read only) / Interfacing / Simple Motor Question on: May 18, 2009, 02:26:48 pm
I tried to find this, but didn't quite.
I need to control 4 motors (or other device) that will rotate an drinking cup (with 2 oz) 90*, one time.  Think along the lines of adding flour to a cake mix.  

I know that I can do this with steppers, but only 2. Would it be as simple as using a small motor, on for 2 secs then off. Use some type of mechanical stop or micro switch ?

Of course I'd use some kind of circuit to drive the motors. Like http://itp.nyu.edu/physcomp/Labs/DCMotorControl
8  Forum 2005-2010 (read only) / News / Re: Arduino PID Library on: November 13, 2008, 02:12:53 pm
I'll try it from the "30,000 foot view".

Imagine that you have cruise control in your car and it is set at 60 mph.

If you are traveling at 30mph and hit resume, the car should apply say 70% power to increase this speed to the target.

However, as you approach that target (say 50 mph), that throttle needs to be decreased, otherwise you will overshoot the target.

Once you reach your target, there will be times that you need to adjust the throttle to maintain that speed. You would likely do this as a small adjustment (1-2%) instead of a On/Off (0 or 100%) adjustment.

From the authors' file he writes:
 *  If none of the above made sense to you, and you would like it to, go to:
 *  http://www.controlguru.com .  Dr. Cooper was my controls professor, and is
 *  gifted at concisely and clearly explaining PID control

I will be using it to accurately control stepped temperatures over a period of time.
9  Forum 2005-2010 (read only) / News / Re: Arduino PID Library on: November 13, 2008, 12:11:24 pm
I am new to using a PID, but will be doing so on a home brewing project ;D

I might suggest some helper functions that allow use of a digital device to simulate PWM (like the BBPID).

I'll be giving this a run this weekend.

EDIT: or I could just read the second example  :-[
Pages: [1]