Show Posts
Pages: 1 ... 39 40 [41] 42 43 ... 344
601  Using Arduino / Motors, Mechanics, and Power / Re: Arduino, 5V relay, 220v: checking I'm not putting myself or others at risks on: September 01, 2014, 06:51:46 am
Subject:

Quote
Arduino, 5V relay, 220v: checking I'm not putting myself or others at risks

If you have to ask, you are.
602  Using Arduino / Project Guidance / Re: Debugging on: September 01, 2014, 06:46:09 am
Not sure exactly what you mean: the serial conn is exactly what you need.... the common approach is to use Serial.print(variablename) and Serial.print("some helpful text") to give you feedback on the serial monitor.

You can see what the variables are up to, and the text can tell you where you are in the flow... eg you can see which branch in an if/else or case is being actioned, has setup() finished, are you back at the top of loop(), etc etc

It's not ideal, by any means, but it works.....

edit....  Another approach, if you have spare pins, is to have some LEDs going on or off to indicate what's happening inside.
603  Using Arduino / Sensors / Re: PIR Sensor: LED keeps blinking non-stop although no detection on: September 01, 2014, 04:00:09 am
Er , Generally speaking, there are 2 protentiometers on the back of the module,  to adjust the duration time and sensitivity.

It's not "generally speaking" at all.... mine doesn't, for example. Mine has neither pots nor jumpers to set the mode.

It depends entirely on how the manufacturer designs the raw sensor into a module.
604  Using Arduino / Sensors / Re: Temperature & Gas Sensor on: September 01, 2014, 02:39:52 am
That depends what sensors you have in mind....
605  Using Arduino / Project Guidance / Re: Robot not turning anymore on: September 01, 2014, 01:30:28 am
This code does a toggle from a momentary switch.

The switch I have is really bouncy: invariable gives 2-3 clicks for the price of 1 so I debounced it in software.

Each click toggles the LED on=>off or off=>on.

Code:
// simple toggle
// switch to ground from pin, internal pullup
// switch is debounced in sw with bounce2 library
// lines marked //** debounce are to do with debouncing
// comment out or delete those lines if not using debouncing
// and uncomment the line marked //** uncomment me.

#include <Bounce2.h> //** debounce

byte buttonPin=2;
byte ledPin=13;

byte ledState = 0;
byte buttonState = 0;
byte lastButtonState = 0;

Bounce dbbuttonPin = Bounce(); //** debounce

void setup()
{
  pinMode(buttonPin, INPUT_PULLUP);
  
  pinMode(ledPin, OUTPUT);
  digitalWrite(ledPin, LOW);
  
  dbbuttonPin.attach(buttonPin); //** debounce
  dbbuttonPin.interval(5); //** debounce

  
}

void loop()
{
  dbbuttonPin.update(); //** debounce
  buttonState=dbbuttonPin.read(); //** debounce
  //buttonState = digitalRead(buttonPin); //uncomment me if not using s/w debounce.
  
  if (buttonState != lastButtonState) //switch changed
  {
    if (buttonState == 0) //0= pressed becuse of pullups ("active low")
    {
      ledState = !ledState; //changed and pressed => toggle led
    }
  }
  
  digitalWrite(ledPin, ledState);
  lastButtonState = buttonState;
  
}
 
  
  
  
606  Using Arduino / Programming Questions / Re: Global Variable Not Initializing? on: August 31, 2014, 11:43:19 pm
Quote
by the time my serial console box opened, the menu had already been "shown"

Hmmmm.... opening the console resets the board though, so the whole thing runs from the top anyway.

(Unless you're not using the IDE's console.... but you say you are.)

Quote
I am looking at the serial monitor on the Arduino IDE
607  Using Arduino / Project Guidance / Re: Robot not turning anymore on: August 31, 2014, 02:03:48 pm
The secret to making a momentary switch into a toggle switch, is to do with not looking to see if is pressed, but rather that it became pressed. That is, you need to keep track of its state and see if that changed.

If it's pressed now, but wasn't before, it just got pressed. But if it's pressed now and was before, then it's still pressed from last time.

Have a look at this example.

I know of Lydenburg- out east in the Lowveld somewhere- never been out that way tough.

608  Using Arduino / Project Guidance / Re: Sorry- very newbie questions on: August 31, 2014, 01:46:54 pm
All the boards are described here and there's a link to a comparison matrix near the top of that page.
609  Using Arduino / Programming Questions / Re: Help required urgently, anyone help possible on: August 31, 2014, 01:12:18 pm
I'm having deja vu..... didn't we do this yesterday?

You have no opening brace here:

Code:
  }
}

  int check()
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    if (Serial.available() > 0)    //Check for data on the serial lines.
    {   
      dataIn = Serial.read();  //Get the character sent by the phone and store it in 'dataIn'.
      if (dataIn == 'F

But you have it here:

Code:
}

int check()
{ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  if (Serial.available() > 0)    //Check for data on the serial lines.
  {   
    dataIn = Serial.read();  //Get the character sent by the phone and store it in 'dataIn'.
       

Your fine tooth comb has a leak....
610  Using Arduino / Project Guidance / Re: help regarding connection for relays 5v on: August 31, 2014, 01:06:49 pm
I/O pins only provide 40mA absolute max, better stick to 20 or so.

The 5V header pin is the one marked below.
611  Community / Website and Forum / Re: In what forum should very newbie questions be posted? on: August 31, 2014, 01:00:35 pm
I don't see a newbie section of the forum so I was wondering what the best place would be if I had some very beginner questions on how to pick a board, comparing features, etc etc?

Project guidance for those sorts of questions, and when you start wanting to attach stuff, probably then the sensor board for input and the motor/power (I forget its actual name) for output devices. When you start coding and get stuck, then there's a programming question board.

Mods move threads if they think it's in a totally wrong place.....
612  Using Arduino / Sensors / Re: PIR Sensor: LED keeps blinking non-stop although no detection on: August 31, 2014, 12:19:14 pm
You might be getting false highs on your input because you don't have a pulldown resistor. The pin might not be  low just because the sensor didn't make it high.

This example shows a pulldown to keep a pin low when a switch doesn't pull it high: your sensor is the switch in your case.

BTW your schematic doesn't show a current limiting resistor in series with the LED.
613  Community / Bar Sport / Arduino Community Logo on: August 31, 2014, 11:00:13 am
Guys and Gals,

You may not have realised there is a logo which is for community use... read all about it here.


<<<<<<<<<<<<<<<<<<   I currently have it in my forum profile.
614  Using Arduino / General Electronics / Re: Arduino gets restart when operating 12V Solid State Relay on: August 31, 2014, 10:55:51 am
But glad I hadn't missed a trick and that flyback diodes were actually required on SSRs. I have been paying attention these last couple of years....

Nope.

SSRs have no inductance so no diode needed.


Yeah that's what I meant... got a bit confused with my own double negatives I don't not think.
615  Using Arduino / General Electronics / Re: Arduino gets restart when operating 12V Solid State Relay on: August 31, 2014, 09:39:20 am
But glad I hadn't missed a trick and that flyback diodes were actually required on SSRs.
Just to be clear: they're NOT required (have no use there.)

Yep, that's what I meant.

I'm wondering if this problem is not power related. Time we saw a circuit: those solenoids .... are the coils running of the Arduino or externally powered, for instance.
Pages: 1 ... 39 40 [41] 42 43 ... 344