Loading...
  Show Posts
Pages: 1 ... 33 34 [35] 36 37 ... 58
511  Using Arduino / Programming Questions / Re: Timing servo on: August 13, 2011, 05:39:46 am
Why are the comments wrong ... (Usual guess: You tried a number of things already). Means I can't use the rest of the comments, as they may be wrong, too.
Code:
int PIRSensor = 3; // the PIR sensor will be plugged at digital pin 2
:
pinMode(PIRSensor, INPUT); // declare the PIRSensor as as OUTPUT

OK, to the real question. "The motor needs to run 5 seconds" - the servo will as quickly as it can go to the position you have sent it. Pease explain what you mean by "running for 5 secs" - use 5 seconds to get to that position or wiggle widly for 5 seconds - or some 3rd thing
512  Using Arduino / Programming Questions / Re: Slow programming (compiling) on: August 13, 2011, 02:59:32 am
Well, diagnose it a bit. Activate the Task Manager and the Resource Manager, possibly Performance Monitor, and see if this is the only consumer of disk IO or CPU resources or something else is getting in the way. Is your memory totally overused (Vista is a bit strange/errant on its memory handling)

On my laptop with WIn7 a typical compile is too slow for my liking (5-10 seconds) but on the XP it is a bit faster.
513  Using Arduino / Programming Questions / Re: Slow programming (compiling) on: August 12, 2011, 12:28:18 pm
Interesting .. the only thing I can think of is some virusscanner getting in the way, insisting on scanning each file before allowing the open on it. Are you other disk operations normal speed?

Well, another thought is something is slowing down the java - some global debug switch ? (way out of my depth here)
514  Community / Bar Sport / Re: UK Badger Extermination- a misguided effort on: August 12, 2011, 11:59:34 am
Maybe this post should be in the "last purchase" thread - as I've recently bought this T-shirt, but it seems appropiate response in a slight OffTopic sort of way)
515  Community / Bar Sport / Re: Your latest purchase on: August 12, 2011, 11:03:19 am
Another batch of 20 x RFP30N06LE - just to have on hand.

BTW, anyone care to suggest a suitable alternative?

And my stock of 328 has been reduced by one - from 3 to 2. Accidentally a MOSFET's (RFP30N06LE) on loose long wires controlling a 24V device, backside (the tab of a TO220 housing) touched (I think) the ICSP header pins. No sound, no glimt, the laptop just went totally black.

After having rebooted the laptop (needed a power cycle with battery removed to wake up again) the Arduino board refused to do anything except light up the green power LED.

Well, having replaced the 328 now, everything works as before. Good thing with all those polyfuses. Otherwise the laptop probably would be toast, too (the power supply is larg(ish), delivering at least 15A at 24V)
516  Community / Bar Sport / Re: Live 3D printing on: August 12, 2011, 10:32:53 am
Drat - missed this post again. Well, now it is on "Notify" ...
517  Using Arduino / Project Guidance / Re: Pond Control Arduino mega 2560 project on: August 12, 2011, 10:06:11 am
The question is too unspecific. Presumably you are not expecting a full wiring diagram and code template. This could be a largish project, but can be segmented into several smaller problems, if and when you encounter them, where you can ask about one at a time in the specific  areas. To give an example of why your specification is too broad at this moment:

"Read and log"  - how often do we need the update? (Guess: It is a large body of water. Once an hour?) How long do you need to log? (Guess between the times you upload to the pc. A few weeks?)

You mention 13 "probes" to measure&log. Fortunatly your Mega has 16 analog inputs. Your probes need to deliver a 0-5V (or 0-3.3V) signal.

You mention 13 outputs plus another 13 (or 26?) inputs. No problem there, as long as you use some transistor circuit to switch the relays.

The LCD screen I have no comments. You know it is 12.1 inches (that is nice and precise measurement) but do not mention characterbased, colour, graphic, resolutin or anumber of other items. It will come with its own controller (presumably) and that is more important to know than its size or water resistance (how many meters depth?)

I presume you already have choosen or purchased some or all sensors? You may be fortunate that someone in the sensors topic area has suggestions for some of them, if not.

IMHO the project is quite doable - except for the large choice of connectivity, if you expect your Mega to handle all of them. It might for example be good to an (old) pc to handle the webserver stuff and just let it have some simple serial/wireless to the Arduino.
518  Using Arduino / Project Guidance / Re: 3 Sensors, 2x Relays 2x LEDS on: August 12, 2011, 09:35:50 am
Is it possible to have the code do two things at once? ie, can I have a green LED always blinking, and still run this code?
As you hinted at yourself (here), you will use millis() and a "timer" (working out when 300 seconds have elapsed).

Hint 1 & Hint 2
519  Using Arduino / Programming Questions / Re: Sending Inverse data's on: August 07, 2011, 05:16:38 am
Or perhaps, to be more "general". (The map() function is  quite flexible, also in inverting range input)
Code:
   myservo1.write(map(hori,0,1023,40,180) );
   myservo2.write(map(hori,0,1023,180, 40) );
Of course, in this variation you do not have the "pos" variable, if you want to do more with it
Servos are not necessarily identical, especially mounting the horn (the bit you screw on the axle) is often off by a degree or two, so you want to "trim". In this case after carefully fiddling with your mechanical setup (assuming it is accuracy you need), your code might be "trimmed" with (example values)
Code:
   myservo1.write(map(hori,0,1023,41,178) );
   myservo2.write(map(hori,0,1023,179, 38) );
to compenstate for the servo/horn mount.
520  Using Arduino / Programming Questions / Re: Power supply controller programming on: August 07, 2011, 05:07:50 am
(Minor note on forum stuff: When posting code, hit the "#"-button and place your cut-n-paste code between the code-brackets)

"Wonder if it will work" .... well, why do you not try it?

If you have a problem telling us what it DID do, and what you EXPECTED it to do, then the answer will be more helpfull smiley

BTW, for values which never ever change (until you recompile a new version) add the keyword const like
Code:
const int Relaypin = 4;
this will help you find programming errors (if you in a lrge code forget it was non-changing) and may consume fewer bytes of the precious RAM store.
521  Using Arduino / Programming Questions / Re: Function calls and memory usage on: August 05, 2011, 04:34:34 pm
all of them end either with return statements or another function call.
That is where you go wrong. That means the function has not exited at all. Either you have a major misunderstanding of functions or I have misread your explanation. But you wrote this twice explicitly and a couple of times indirectly.

There is something called co-routines but I do not think that can be setup in C - function calls are strictly nested.

Give us the source (or an reduced set of it) so we can comment/confirm/correct. (If it is too large, attach it as a file)
522  Using Arduino / LEDs and Multiplexing / Re: Handling several 5x7 matrices on: August 04, 2011, 04:25:31 pm
The "toy" program also does the schematic and an board layout (yeah, not perfect, but still ...)

Anyhow, Hawkes; click on the "schematic" tab on the top and you get the box and line drawing that GrumpMike needs to comment. You may want to use PDF as the export file format.
523  Using Arduino / Motors, Mechanics, and Power / Re: Bipolar Stepper Motor w/L298N Problems! on: August 04, 2011, 03:49:51 pm
I will not attempt to check your wiring from the pictures. I think it is hard enough to that even if I had the breadboard in my hands.  smiley-wink

It makes a difference for (some) steppers if you reverse the polarity of connecting your coils.

The last code you posted is simple enough. So, the inevitable conclusion arises: There is still a wiring error. I have been down that path. Checked, rechecked, convinced it was correct, and then after faultfinding for the uumpteenth time find the miswiring anyhow.

There may be a fault in you wiring as you may be using the wrong schematic. (My first L298N was fried as I had read the pinout mirrored -  smiley-roll-blue ) Have you used an Ohm meter to verify that the motor wire/colors are as expected?

Hang on in there! Sleep, give it another shot.
524  Using Arduino / Motors, Mechanics, and Power / Re: VarSpeedServo - a modified Servo library with speed control on: August 04, 2011, 03:22:27 pm
Quote
Would something like that be useful or will most people want the capability
I am not "most people", despite my inflated ego smiley But as you see from my reply earlier, I would have found that usefull.

My sweep used a millis() timer construct. For me - not a big hassle to program, but I know from many of the threads here, that it will be too much for many people to "do more than one thing" (ie let the sweep progress without disturbing other processing.) As I do not (yet) have any experience in accessing the hardware timers I do not know how much hassle it is to add that in the timer/interrupt code - or if it would limit the max number of servos.

(My sweep code has an advantage that I can do something synchronized with two servos. In an built in function one would need to change the sweep rate for each "ratio".)

The alternative is to let the sweep be "blocking", ie calling servo.write with asweep value will take the time it takes. I would not like a servo.updatesweep() to be called "often" for the sweep to work.
525  Community / Website and Forum / Re: Loop Back Test - Sticky? on: August 04, 2011, 02:08:26 pm
#2.

I amwas tempted to test this - I did not think baudrate was irellevant. But rather than voice  an uinformed opinion I tested - and now I know. With hindsight, obvious.

I will do the #2 doing exactly what it says. WIthout enganging too many brain cells (Nice evening here, dusk, beer in hand ... attached picture as proof)

Excellent instructions. I skipped one (by accident) and things did not work - then I did not skip it - and everything worked. It will be interesting to see if the sticky will have many false alarms for the same reason. And no, I cant think of any instruction to add to stop that from happening.

My only comment for possible improvment is that at point 8. If it does echo everything, then the USB/driver/chip is working

(edited this pst to reflect the test was done, rather than just intended)
Pages: 1 ... 33 34 [35] 36 37 ... 58