Go Down

Topic: Serial monitor infinite output (Read 2894 times) previous topic - next topic


Nick Gammon

I'm confused about what the device is, still. As in, its part number.

You don't generally connect things via a single wire. Does the device have a ground wire? Is it wired to the Arduino ground?

Quote
i don't have a photo or a schematic sir,


Do you have a phone with a camera in it? How about using it?

Quote
here's what my output is


I believe you. You don't have to attach a screenshot. You can copy and paste from the output window.
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

zer0_JuLz

here's what the device is... i bet it is just newly constructed so got no full ideas about it.

http://www.e-gizmo.com/KIT/NEWIR.htm

but i will try all your suggestions now sir...thanks a lot. u guys got my sincere gratitudes :smiley-red:

zer0_JuLz

http://www.e-gizmo.com/KIT/images/11functions/11%20function%20technical%20manual.pdf

found this manual sirs

zer0_JuLz


Code: [Select]
  pinMode(forwardPin, INPUT);
  digitalWrite(forwardPin, HIGH); // Turn on the pullup resistor.




so the new code will be like this?
Code: [Select]
int forwardPin = 12;

void setup()
{
  Serial.begin(9600);
  pinMode(forwardPin, INPUT);
  digitalWrite(forwardPin, HIGH);
}

void loop()
{
  int forwardState = digitalRead(forwardPin);
  if (forwardState == HIGH)
  {
    Serial.println("HIGH");
    delay(1000);
  }
  else
  {
    Serial.println("LOW");
    delay(1000);
  }
}

Arrch


so the new code will be like this?


Why not try it and tell us?

GoForSmoke

With those 1 second delays you're not going to read more than the fact a signal was sent from the remote and that only by luck.

Try keeping track of what state the pin was last time it was read and only printing when the state changed. Then take the delays out. But fix the wiring first.

Nick Gammon on multitasking Arduinos:
1) http://gammon.com.au/blink
2) http://gammon.com.au/serial
3) http://gammon.com.au/interrupts

zer0_JuLz


Code: [Select]
  pinMode(forwardPin, INPUT);
  digitalWrite(forwardPin, HIGH); // Turn on the pullup resistor.



will it also work if i make it a pull down resistor? some like...
Code: [Select]
pinMode(forwardPin, INPUT);
  digitalWrite(forwardPin, LOW); // Turn on the pulldown resistor

AWOL

No, there are no built in pulldowns
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

zer0_JuLz


No, there are no built in pulldowns


thanks sir that helped a lot ^^

Nick Gammon

Code: [Select]

pinMode(forwardPin, INPUT);
digitalWrite(forwardPin, LOW);   // turn off the pull-up resistor


All that second line does is turn off the pull-up. There had to be a way of doing it, and this is it.
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

zer0_JuLz


Code: [Select]

pinMode(forwardPin, INPUT);
digitalWrite(forwardPin, LOW);   // turn off the pull-up resistor


All that second line does is turn off the pull-up. There had to be a way of doing it, and this is it.


oh really sir?! gee thanks! i will try it now

arduinohabib

Do you know how to wire a pull-down resistor?
What is man's best friend? The breadboard!

zer0_JuLz


Do you know how to wire a pull-down resistor?


yes sir i read about it

arduinohabib

I'm really not used to someone calling me sir :) :) :) check my profile. Just call me Habib  :)
What is man's best friend? The breadboard!

Go Up