Arduino Forum upgrade scheduled for Monday, October 20th, 11am-4pm (CEST). Sorry for the inconvenience!
Pages: 1 [2] 3   Go Down
Author Topic: Serial monitor infinite output  (Read 2478 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset



here's what my output is
Logged

Global Moderator
Melbourne, Australia
Offline Offline
Brattain Member
*****
Karma: 535
Posts: 19768
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

http://gammon.com.au/electronics
Please post technical questions on the forum - not by personal message. Thanks!

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

found this manual sirs
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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


so the new code will be like this?
Code:
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);
  }
}
Logged

California
Offline Offline
Faraday Member
**
Karma: 92
Posts: 3453
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

so the new code will be like this?

Why not try it and tell us?
Logged

Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 100
Posts: 4869
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

 
Logged

I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
  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:
pinMode(forwardPin, INPUT);
  digitalWrite(forwardPin, LOW); // Turn on the pulldown resistor
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 318
Posts: 26927
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No, there are no built in pulldowns
Logged

"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.

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No, there are no built in pulldowns

thanks sir that helped a lot ^^
Logged

Global Moderator
Melbourne, Australia
Offline Offline
Brattain Member
*****
Karma: 535
Posts: 19768
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
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.
Logged

http://gammon.com.au/electronics
Please post technical questions on the forum - not by personal message. Thanks!

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
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
Logged

Beijing
Offline Offline
Full Member
***
Karma: 3
Posts: 193
Skype name habib.derbyshire
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

What is man's best friend? The breadboard!

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

yes sir i read about it
Logged

Beijing
Offline Offline
Full Member
***
Karma: 3
Posts: 193
Skype name habib.derbyshire
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm really not used to someone calling me sir smiley smiley smiley check my profile. Just call me Habib  smiley
Logged

What is man's best friend? The breadboard!

Pages: 1 [2] 3   Go Up
Arduino Forum upgrade scheduled for Monday, October 20th, 11am-4pm (CEST). Sorry for the inconvenience!
Jump to: