Loading...
  Show Posts
Pages: 1 ... 36 37 [38] 39 40 ... 118
556  General Category / General Discussion / Re: Is Arduino Output Dangerous? on: March 16, 2013, 11:25:03 am
Wikipedia, which may be where you got the 10mA thing from, tells us that the human body's resistance is something like 100,000 Ohms.

Applying that to Ohm's Law (V=IR or I=V/R) as lefty rightly (haha) points out above, gives us 5 / 100000 = 0.00005 Amps which if I counted the zeroes correctly is 5E-5 or 50 microAmps. Certainly very small...

If it worked the way you thought, ie that current is pushed as opposed to pulled as lefty pointed out, and 5V at 40mA was lethal, how would anybody survive touching a 12V car battery which can supply 100s of Amps?
557  Using Arduino / Audio / Re: Struggling to get a photo cell to control velocity on: March 16, 2013, 11:12:21 am
Have a look at this tutorial over at adafruit. Specifically, this page shows a) how to read the cell's voltage and b) how to use that to control the brightness of an LED using PWM.

The LED's brightness could be analogous to your volume, but I'll leave that part to you.  smiley-cool
558  Using Arduino / Project Guidance / Re: Reed-switch counter HELP. on: March 16, 2013, 07:01:33 am
Post your code and we'll have a look at it....

Have you done the simple "starter" tutorials, like blink and so on?

EDIT....

Rather than debounce, you should actually look at the Button State Change tutorial, which exactly what you want except it uses modulo 4 to count in 4's not the 3's you need. (Although it's not debounced... you may still need to combine the two)
559  Using Arduino / Sensors / Debounce tutorial isn't a toggle... or is it? on: March 16, 2013, 06:47:58 am
(I've put this under Sensors, since a switch is a sensor...)

With a need to debounce a switch in a project, I decided to check out the debounce tutorial for the first time.

I understand the debounce stuff... allowing a certain time to pass before "accepting" the press; happy with that.

But the tutorial says it also acts as a toggle switch:

Quote
This example demonstrates the use of a pushbutton as a switch: each time you press the button, the LED (or whatever) is turned on (if it's off) or off (if on)

Well it doesn't toggle for me: just works as a normal (albeit debounced) momentary switch... the LED is on when the switch is pressed, and off when it's not. It doesn't stay on after a press-release, it goes off.Walking through the code, I see where the debounce comes in, but don't see a toggle mechanism.

Is the narrative to the tutorial out of whack with the code, or am I missing the plot, here?

Edit: I don't need a toggle switch, I actually just need a debounced momentary switch, so I'm not fussed that it isn't a toggle. Just confused in case it is a toggle and I'm not getting that part.
560  Using Arduino / Project Guidance / Re: Reed-switch counter HELP. on: March 16, 2013, 05:37:59 am
Well I'm no "pro", that's for sure, but these two things spring to mind:

The reed switch will work like any other momentary switch, and will almost certainly need de-bouncing else you'll get a false count. So if you didn't already, take a look at the debounce tutorial.

Once you have that working, and of course keeping a count of how many pushes you have (or in your case, passes of the magnet) you're out by a factor of three. So have a look at modulo which gives you a remainder of a division... you would want a message when count modulo 3 is 0.

HTH?
561  Using Arduino / Motors, Mechanics, and Power / I just forgot my own advice... on: March 16, 2013, 04:34:17 am
Was wondering why my servo wasn't following the potentiometer properly, not going the full 180, erratic buzzing blah blah blah, all the usual symptoms.

Much scratching of head..... flaw in the code?... fried servo?... flat batteries?

Nope, I forgot the Arduino / breadboard / servo ground wire.

smiley-red
562  Topics / Robotics / Re: Servo Replay on: March 16, 2013, 12:47:47 am
I haven't thought this through, so the following might be absolute cr@p, but how about recording only important way-points? (Much like on a GPS on a trip, you can hit a button to record certain points rather than recording the whole trip metre by metre....)

If I use the pot to drive my servo from where it is to a certain point, say centre (90) to one side (180), if (and I repeat the if) I don't need to to know that it was at 100 at a certain time, and 110 a tiny bit later, then I could hit a "store" button when it's at the destination to put 180 into an eeprom location (or even just into an array for testing purposes).

Later, when I replay, it would go to 180...

As I say I haven't thought this through but food for thought for a rainy Johannesburg weekend...
563  Using Arduino / Programming Questions / Re: need help with writing a program on: March 15, 2013, 11:37:03 am
See if this does the trick....

Code:
void setup() {
  //
  //force 13 led off... having it on by mistake pisses me off
  pinMode(13, OUTPUT);
  digitalWrite(13, LOW);
 
  //start the serial monitor
  Serial.begin(9600);
 
  //here's our 0 to 30 loop
  //it initializes ctr inside the "for"
 
  for (int ctr=1; ctr <= 30; ctr++){
      // print each value as a check that the "for" works
      Serial.println(ctr);    // comment this line out if you don't want it
     
      // and pay special attention to the values 1, 3, 8, 29
      // the || means OR
      if (ctr == 1 || ctr == 3 || ctr == 8 || ctr == 29)
      {
        Serial.print("Reading: ");  // prints "Reading:  " with no line end
        Serial.println(ctr);          // prints value of ctr with a line end
      }
   }

}

void loop() {
 
  // in this case we only want it to run once to the whole thing is up top in setup()
 
 
}
564  Using Arduino / Project Guidance / Re: Can I Program my Arduino in C? on: March 15, 2013, 11:02:52 am
Is there any other way?
565  Using Arduino / Installation & Troubleshooting / Re: analoge input problem on: March 15, 2013, 10:55:21 am
Hi

Does Arduino read input negative values (sine wave) or just positive values ?

Well let's put it this way, it reads signals between 0V and 5V....
566  Using Arduino / Project Guidance / Re: help :6servos control on: March 15, 2013, 10:43:21 am
Forum member DuaneB is a bit of a servo guru, and has created this blog
567  Using Arduino / Motors, Mechanics, and Power / Re: Minimum possible angle movement of HS 311 Servo motor on: March 15, 2013, 10:31:54 am
Are you sure the servo can be positioned as closely as you want in the first place?

I am not sure on that either.  smiley-confuse I guess, it depends on the gear and the teeth assembly?


Yes I see that's a nylon geared one... and I also read that sometimes there's an intrinsic lack of positioning ability in the potentiometer mechanism in a servo. I'd be really surprised if you can get even repeatably to anything like a degree. But that's me just guessing...

So what I'm going to do is rig up some kind of pointer / protractor thing this weekend and see what kind of luck I have. I've got a couple of standard size HK15138s and micro size HXT900s.

What sort of loading will your servo be subject to?

Edit... hey ZK, that's exactly the kind of rig I have in mind... I was thinking 1/2 degree tops, most likely even 1 degree. We'll see.....
568  Using Arduino / Project Guidance / Re: infrared sensor connecting to computer on: March 15, 2013, 09:44:09 am
GFS I think the OP is talking about the player's speed being tested over a 30m dash....
569  Using Arduino / Motors, Mechanics, and Power / Re: Minimum possible angle movement of HS 311 Servo motor on: March 15, 2013, 09:36:22 am
Are you sure the servo can be positioned as closely as you want in the first place?
570  Topics / Robotics / Re: HELP! Servo keeps running (with just attach() method)!! on: March 15, 2013, 12:42:18 am
Quote
I can't even do that because as soon as I connect signal wire, it starts turning....

Oh yeah, my bad...

I can't think what the problem might be- something mechanical probably... if your son perhaps wrenched the horn past one of the end stops could that have done this?- I don't know. (I do know that one of the mods you need to make to a normal servo to make it continuous is remove the end stops.)
Pages: 1 ... 36 37 [38] 39 40 ... 118