# Processing no compiles on Arduino UNO R3

**URL:** https://discourse.processing.org/t/processing-no-compiles-on-arduino-uno-r3/40721
**Category:** Electronics (Arduino, etc.)
**Created:** [January 26, 2023, 11:39am UTC](https://discourse.processing.org/t/processing-no-compiles-on-arduino-uno-r3/40721 "2023-01-26T11:39:29Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![roberto64](https://avatars.discourse-cdn.com/v4/letter/r/90ced4/32.png) [@roberto64](https://discourse.processing.org/u/roberto64)
#### Post date: [January 26, 2023, 11:39am UTC](https://discourse.processing.org/t/processing-no-compiles-on-arduino-uno-r3/40721/1 "2023-01-26T11:39:29Z")

</div>

hi I installed processing to make applications with arduino, but I’ve been trying to make a simple arduino program like Blink work for two days but nothing I state that with Arduino ide 2.03 it works well, but when I clear processing nothing, I state that it brings them" / dev/cu.usbmodem14701" I see it but when I compile the program for arduino uno nothing the BLINK program does not start. i use a hackintosh with catalina ver.10.15.7, any solution thanks

---

<div class="post-metadata">

### Author: ![RichardDL](https://avatars.discourse-cdn.com/v4/letter/r/f475e1/32.png) [@RichardDL](https://discourse.processing.org/u/RichardDL)
#### Post date: [January 26, 2023, 2:58pm UTC](https://discourse.processing.org/t/processing-no-compiles-on-arduino-uno-r3/40721/2 "2023-01-26T14:58:51Z")

</div>

Hi Roberto, Welcome to the forum. I think you are a little confused by things.

To put a program (often referred to as a sketch), e.g. Blink, in your Arduino you need the Arduino IDE from the [Arduino website](https://www.arduino.cc/). The language is C++.

Processing allows you to write Java programs to run on your PC.

Please note these and try not to be confused:

- The Processing IDE and the Arduino IDE have developed from the same software. They look quite like each other

- Java and C++ both developed from C and they are quite similar.

- Many people use Processing to talk via serial to the program running in the Arduino. This is mostly what this section of the forum is about.

- In the Processing Examples (File, Examples, Libraries, Serial) e.g. SimpleRead the Processing example contains the Arduino code as comment. You have to copy it out into the Arduino IDE and load it into the Arduino.

Hope this helps, please try things and ask again if you like.

---

<div class="post-metadata">

### Author: ![roberto64](https://avatars.discourse-cdn.com/v4/letter/r/90ced4/32.png) [@roberto64](https://discourse.processing.org/u/roberto64)
#### Post date: [January 26, 2023, 3:57pm UTC](https://discourse.processing.org/t/processing-no-compiles-on-arduino-uno-r3/40721/3 "2023-01-26T15:57:46Z")

</div>

I think I explained myself badly, the problem is that arduino writes in C and I know this, processing is a more simplified java and this also happens, my problem is that by writing an example with processing Exp. I run in processing but the arduino does absolutely nothing, instead running the Arduino ide and with his example of Blink everything works, in a few words running the arduno ide in the arduino and everything OK, instead run it with processing like the example does nothing.  
Thank you  
import cc.arduino._;  
import processing.serial._;

Serial serial;  
Arduino arduino;

void setup() {  
// println(serial.list());  
println(Arduino.list());  
String pname = Serial.list()[2];  
print(pname);  
// arduino = new Arduino(this,pname,57600);  
arduino = new Arduino(this, Arduino.list()[2], 9600);

arduino.pinMode(9, Arduino.OUTPUT);  
}

void draw()  
{

arduino.digitalWrite(0, Arduino.HIGH);  
delay(1000);

arduino.digitalWrite(9, Arduino.LOW);  
delay(1000);  
}

---

<div class="post-metadata">

### Author: ![RichardDL](https://avatars.discourse-cdn.com/v4/letter/r/f475e1/32.png) [@RichardDL](https://discourse.processing.org/u/RichardDL)
#### Post date: [January 26, 2023, 4:05pm UTC](https://discourse.processing.org/t/processing-no-compiles-on-arduino-uno-r3/40721/4 "2023-01-26T16:05:00Z")

</div>

I think you are writing a Processing program that talks to the Arduino using the Arduino object.

This requires the program ‘Firmata’ to be running in the Arduino. Arduino IDE, File, Examples, Firmata, Standard Firmata. Compile, Load, wait for load to finish. Run Processing.

You will see there are lots of versions of Firmata. I’ve only used Firmata very briefly and don’t know what all the different versions are for.

You must have your Processing sketch stopped while you (compile and) load the Arduino.

---

<div class="post-metadata">

### Author: ![roberto64](https://avatars.discourse-cdn.com/v4/letter/r/90ced4/32.png) [@roberto64](https://discourse.processing.org/u/roberto64)
#### Post date: [January 26, 2023, 4:23pm UTC](https://discourse.processing.org/t/processing-no-compiles-on-arduino-uno-r3/40721/5 "2023-01-26T16:23:22Z")

</div>

no not only this also using the serial Exp. always the same thing  
void setup() {  
for (int i =0;i\<Serial.list().length; i++) {  
print(i + " ");  
println(serial.list()[i]);  
}

```
String pname = Serial.list()[5];
serial = new Serial(this,pname,9600);

```

}

void draw() {

if (serial.available() \> 0 ) {  
String val = serial.readStringUntil(‘\n’);  
}  
}  
always the same thing

---

<div class="post-metadata">

### Author: ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)
#### Post date: [January 26, 2023, 5:01pm UTC](https://discourse.processing.org/t/processing-no-compiles-on-arduino-uno-r3/40721/6 "2023-01-26T17:01:21Z")

</div>

Try reading the data with serialEvent():

```auto
// Example by Tom Igoe 
 
import processing.serial.*; 
 
Serial myPort; // The serial port
String inString; // Input string from serial port
int lf = 10; // ASCII linefeed 
 
void setup() { 
  size(400,200); 
  // List all the available serial ports: 
  printArray(Serial.list()); 
  myPort = new Serial(this, Serial.list()[3], 9600); 
  myPort.bufferUntil(lf); 
} 
 
void draw() { 
  background(0);
  textSize(24.0);
  text("received: " + inString, 10,50); 
} 
 
void serialEvent(Serial p) { 
  inString = p.readString(); 
}

```

Make sure that your Arduino is sending something:  
**Arduino code:**

```auto
void setup() {
 Serial.begin(9600);
 Serial.println("Processing is great.");
}

void loop() {
}

```

---

<div class="post-metadata">

### Author: ![roberto64](https://avatars.discourse-cdn.com/v4/letter/r/90ced4/32.png) [@roberto64](https://discourse.processing.org/u/roberto64)
#### Post date: [January 26, 2023, 5:25pm UTC](https://discourse.processing.org/t/processing-no-compiles-on-arduino-uno-r3/40721/7 "2023-01-26T17:25:45Z")

</div>

> [@svan](#):
>
> Try reading the data with serialEvent():

nothing received null

---

<div class="post-metadata">

### Author: ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)
#### Post date: [January 26, 2023, 5:36pm UTC](https://discourse.processing.org/t/processing-no-compiles-on-arduino-uno-r3/40721/8 "2023-01-26T17:36:37Z")

</div>

`nothing received null`

Did your arduino send anything? Arduino and Processing have to be paired. What one side is programmed to send, the other side has to be programmed to receive.

You mentioned testing the ‘blink’ example in Arduino. Try using this set of code, one set for the arduino to receive and light up a LED on your arduino board and the Processing app to repeatedly send a zero or a one: zero = turn LED off, one = turn LED on.

**Processing send:**

```auto
import processing.serial.*;

Serial myPort;

void setup() {
  // List all the available serial ports:
  printArray(Serial.list());
  // Open the port you are using at the rate you want:
  myPort = new Serial(this, Serial.list()[7], 9600);
}

void draw() {
  myPort.write(1); // turn on led
  delay(1000);
  myPort.write(0); // turn off led
  delay(1000);
}

```

**Arduino receive:**

```auto
int incomingByte = 0; // for incoming serial data

void setup() {
  Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
  delay(2500);
  if (Serial.available() > 0) {
    // read the incoming byte:
    incomingByte = Serial.read();
    switch (incomingByte) {
      case 0 : digitalWrite(LED_BUILTIN, LOW);
        break;
      case 1 : digitalWrite(LED_BUILTIN, HIGH);;
        break;  
      default: Serial.println("something else");
    }
}
}

```

---

<div class="post-metadata">

### Author: ![roberto64](https://avatars.discourse-cdn.com/v4/letter/r/90ced4/32.png) [@roberto64](https://discourse.processing.org/u/roberto64)
#### Post date: [January 26, 2023, 5:59pm UTC](https://discourse.processing.org/t/processing-no-compiles-on-arduino-uno-r3/40721/9 "2023-01-26T17:59:04Z")

</div>

[quote=“svan, post:8, topic:40721”]

```auto
import processing.serial.*;

Serial myPort;

void setup() {
  // List all the available serial ports:
  printArray(Serial.list());
  // Open the port you are using at the rate you want:
  myPort = new Serial(this, Serial.list()[7], 9600);
}

void draw() {
  myPort.write(1); // turn on led
  delay(1000);
  myPort.write(0); // turn off led
  delay(1000);
}

```

[/quotenothing no answer with your 2 examples, see you tomorrow I have to leave. Greetings and Thanks for your cooperation

---

<div class="post-metadata">

### Author: ![roberto64](https://avatars.discourse-cdn.com/v4/letter/r/90ced4/32.png) [@roberto64](https://discourse.processing.org/u/roberto64)
#### Post date: [January 27, 2023, 2:47pm UTC](https://discourse.processing.org/t/processing-no-compiles-on-arduino-uno-r3/40721/10 "2023-01-27T14:47:18Z")

</div>

Hi Svan, trying the two codes by loading the code in arduino and loading the code in processing and running it, it works, I think it’s signature of processing that doesn’t work, another alternative of signature for arduino operation without creating code with arduino IDE and but only with processing?  
Greeting

---

<div class="post-metadata">

### Author: ![roberto64](https://avatars.discourse-cdn.com/v4/letter/r/90ced4/32.png) [@roberto64](https://discourse.processing.org/u/roberto64)
#### Post date: [January 27, 2023, 3:11pm UTC](https://discourse.processing.org/t/processing-no-compiles-on-arduino-uno-r3/40721/11 "2023-01-27T15:11:15Z")

</div>

Understood the functioning you had to first load the Firmata in arduino and then run processing with the signature library.  
Greeting

---

<div class="post-metadata">

### Author: ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)
#### Post date: [January 27, 2023, 4:10pm UTC](https://discourse.processing.org/t/processing-no-compiles-on-arduino-uno-r3/40721/12 "2023-01-27T16:10:53Z")

</div>

> [@roberto64](#):
>
> arduino operation without creating code with arduino IDE and but only with processing

Personally, I’ve never seen that done. If I understand correctly you want to blink an LED on an arduino board without programming it, using only Processing? If you post the code which fails we could try to help you further.

---

<div class="post-metadata">

### Author: ![roberto64](https://avatars.discourse-cdn.com/v4/letter/r/90ced4/32.png) [@roberto64](https://discourse.processing.org/u/roberto64)
#### Post date: [January 27, 2023, 4:18pm UTC](https://discourse.processing.org/t/processing-no-compiles-on-arduino-uno-r3/40721/13 "2023-01-27T16:18:21Z")

</div>

Thank you for your collaboration, but I understood to make arduino work you must first compile the program by inserting it esp"the library of firmabase.h" arduino and then with the serial or with the signature of processing run the code, I thought that processing could make it work Arduino directly without injecting the arduino code.  
thank you

---

<div class="post-metadata">

### Author: ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)
#### Post date: [January 27, 2023, 4:28pm UTC](https://discourse.processing.org/t/processing-no-compiles-on-arduino-uno-r3/40721/14 "2023-01-27T16:28:49Z")

</div>

Arduino code is compiled by the Arduino editor. Processing code is compiled by the Processing editor. They are separate editors, and one won’t compile code for the other.

---

<div class="post-metadata">

### Author: ![RichardDL](https://avatars.discourse-cdn.com/v4/letter/r/f475e1/32.png) [@RichardDL](https://discourse.processing.org/u/RichardDL)
#### Post date: [January 27, 2023, 9:56pm UTC](https://discourse.processing.org/t/processing-no-compiles-on-arduino-uno-r3/40721/15 "2023-01-27T21:56:31Z")

</div>

One method of controlling the Arduino from a Processing program is to use the Arduino object in Processing. This talks to the program Firmata running in the Arduino. See my earlier post.

I made a simple [example](https://discourse.processing.org/t/processing-and-arduino-serial-example/31650). You need to put the Arduino code in the Arduino. Adjust the serial port name in the Processing sketch, and I’m almost certain it will work.

* * *

There is a difficult problem that I found on Arduino Mega, and was the issue in this [topic](https://discourse.processing.org/t/program-slower-when-i-send-data-to-arduino/19815/6). The Arduino Serial was failing if it was sent a char when it wasn’t ready. I’ve only seen/heard of this on a Mega. I’m wondering if the Uno R3 has the same problem but I don’t have one to try.

When you start your Processing sketch, the Arduino resets. At that point have 500mS delay before sending to the Arduino. It think this will avoid the problem.

---

<div class="post-metadata">

### Author: ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)
#### Post date: [January 28, 2023, 10:31pm UTC](https://discourse.processing.org/t/processing-no-compiles-on-arduino-uno-r3/40721/16 "2023-01-28T22:31:08Z")

</div>

Hi @roberto64  
[https://learn.sparkfun.com/tutorials/connecting-arduino-to-processing/all](https://learn.sparkfun.com/tutorials/connecting-arduino-to-processing/all)
