No input but output


hi guys.
input not exist.
but if run coding, got output on serial monitor.
other analogpin same.
so think arduino problem.
my arduino arduino ethernet arduino usb 2 serial converter.
how can fix problem?
thank reading question.
any advice or comment welcome.



int analogpin = 1;

void setup()
{
  serial.begin(9600);
}

void loop()
{
  float reading = analogread(analogpin);
  float voltage = reading / 204.6;
  serial.print("reading=");
  serial.print(reading);
  serial.print("\t\tvolts=");
  serial.println(voltage);
  delay(500);
}

ing=222.00      volts=1.09
reading=222.00      volts=1.09
reading=222.00      volts=1.09
reading=222.00      volts=1.09
reading=222.00      volts=1.09
reading=222.00      volts=1.09
reading=222.00      volts=1.09
reading=220.00      volts=1.08
reading=219.00      volts=1.07
reading=220.00      volts=1.08
reading=221.00      volts=1.08
reading=221.00      volts=1.08
reading=221.00      volts=1.08
reading=221.00      volts=1.08
reading=221.00      volts=1.08
reading=221.00      volts=1.08
reading=222.00      volts=1.09
reading=222.00      volts=1.09
reading=221.00      volts=1.08
reading=222.00      volts=1.09


i don't have board pokipoki, give thoughts anyway: try using int analogpin = a1; instead of 1. analogread() function works on analog pins.

also, if unconnected pin read, result (semi) random number.

can provide more information have hooked up?

also, please read post @ top of post list, called "how use forum", has suggestions (well, rules actually) how attract in post. part code tags.


Arduino Forum > Using Arduino > Project Guidance > No input but output


arduino

Comments

Popular posts from this blog

Error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode - Raspberry Pi Forums

class MPU6050 has no member named begin

missing filename after '-o'