# Using Serial data in real time?

**URL:** <https://discourse.processing.org/t/using-serial-data-in-real-time/5056>\
**Category:** Electronics (Arduino, etc.)\
**Created:** [October 31, 2018, 3:35pm UTC](https://discourse.processing.org/t/using-serial-data-in-real-time/5056 "2018-10-31T15:35:05Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![csanyipal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/csanyipal/32/2115_2.png) [@csanyipal](https://discourse.processing.org/u/csanyipal)\
**Post date:** [October 31, 2018, 4:28pm UTC](https://discourse.processing.org/t/using-serial-data-in-real-time/5056/3 "2018-10-31T16:28:51Z")

</div>

Yes, of course, here is the code for Arduino IDE:

```auto
/*
  Arduino Starter Kit example
  Project 14 - Tweak the Arduino Logo

  This sketch is written to accompany Project 14 in the Arduino Starter Kit

  Parts required:
  - 10 kilohm potentiometer

  Software required:
  - Processing (3.0 or newer) http://processing.org
  - Active Internet connection

  created 18 Sep 2012
  by Scott Fitzgerald

  http://www.arduino.cc/starterKit

  This example code is part of the public domain.
*/

void setup() {
  // initialize serial communication
  Serial.begin(9600);
}

void loop() {
  // read the value of A0, divide by 4 and send it as a byte over the
  // serial connection
  Serial.write(analogRead(A0) / 4);
  //Serial.println(analogRead(A0) / 4);
  delay(1);
}

```

---

_[View the full topic](https://discourse.processing.org/t/using-serial-data-in-real-time/5056)._
