# Reading Arduino Pin

**URL:** https://discourse.processing.org/t/reading-arduino-pin/11682
**Category:** Electronics (Arduino, etc.)
**Created:** [May 29, 2019, 3:40pm UTC](https://discourse.processing.org/t/reading-arduino-pin/11682 "2019-05-29T15:40:33Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Aryn](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@Aryn](https://discourse.processing.org/u/Aryn)
#### Post date: [May 29, 2019, 3:40pm UTC](https://discourse.processing.org/t/reading-arduino-pin/11682/1 "2019-05-29T15:40:33Z")

</div>

Hello, I’m working on a project but never used Processing before. I’m having some troubles in reading an Arduino pin state with Processing.  
I have a LED connected to my PIN13, I opened StandardFirmata in Arduino and set my pin LED always HIGH. Then I wrote the following code in Processing:

```auto
import processing.serial.*;
import cc.arduino.*;
Arduino arduino;
int ledPin = 13;

void setup()
{
//println(Arduino.list());
arduino = new Arduino(this, Arduino.list()[0], 57600);
arduino.pinMode(ledPin, Arduino.INPUT);
}

void draw()
{
  int b = arduino.digitalRead(ledPin);
       println(b); 
}
  

```

but what I get in the screen is always 0. It looks Processing can’t read the actual state of my pin13. What should I do? I have searched a lot on internet but couldn’t find any help. I found another similar Topic here but the solutions proposed there didn’t solve my problem.

Thank you.

---

<div class="post-metadata">

### Author: ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)
#### Post date: [May 29, 2019, 5:08pm UTC](https://discourse.processing.org/t/reading-arduino-pin/11682/2 "2019-05-29T17:08:26Z")

</div>

- [Forum.Processing.org/two/discussion/14534/myport-available-always-0#Item\_1](http://Forum.Processing.org/two/discussion/14534/myport-available-always-0#Item_1)
