# Electronics (Arduino, etc.)

**URL:** https://discourse.processing.org/c/processing/processing-electronics/25.md?page=8

[Latest](https://discourse.processing.org/latest.md) · [Categories](https://discourse.processing.org/categories.md) · [Tags](https://discourse.processing.org/tags.md)

**Page:** 9

---

## [Trying to store the previous value of a variable](https://discourse.processing.org/t/trying-to-store-the-previous-value-of-a-variable/31606)

<div class="topic-metadata">

**Author:** [@G03TH3](https://discourse.processing.org/u/G03TH3)\
**Replies:** 6\
**Last updated:** [August 10, 2021, 8:45am UTC](https://discourse.processing.org/t/trying-to-store-the-previous-value-of-a-variable/31606 "2021-08-10T08:45:22Z")

</div>

I’m attempting to create a ball that is moved through the x-axis reading data from an ultrasonic sensor connected to an Arduino, since the ultrasonic sensor sometimes does not gets the wished value for a second(given to …

---

## [Processing to read Arduino](https://discourse.processing.org/t/processing-to-read-arduino/31614)

<div class="topic-metadata">

**Author:** [@Kanuta](https://discourse.processing.org/u/Kanuta)\
**Replies:** 7\
**Last updated:** [August 9, 2021, 10:32am UTC](https://discourse.processing.org/t/processing-to-read-arduino/31614 "2021-08-09T10:32:12Z")

</div>

Hello! I am trying to get Processing to read LDR sensor values from Arduino to create moving images but it doesn’t seem to work. Arduino reads the changes fine but Processing keeps showing 0’s and constant numbers. I am…

---

## [Null Pointer Exception with Arduino Communication](https://discourse.processing.org/t/null-pointer-exception-with-arduino-communication/31500)

<div class="topic-metadata">

**Author:** [@PapiAli](https://discourse.processing.org/u/PapiAli)\
**Replies:** 19\
**Last updated:** [August 3, 2021, 4:58pm UTC](https://discourse.processing.org/t/null-pointer-exception-with-arduino-communication/31500 "2021-08-03T16:58:40Z")

</div>

So I am running into this issue with my Processing code where I am getting null pointer exceptions whenever it runs over the port.write() line. Just for some background, what I am trying to do is have the Processing cod…

---

## [Serial Communication / Simulink](https://discourse.processing.org/t/serial-communication-simulink/31516)

<div class="topic-metadata">

**Author:** [@MJAhmadi](https://discourse.processing.org/u/MJAhmadi)\
**Replies:** 2\
**Last updated:** [August 2, 2021, 4:03pm UTC](https://discourse.processing.org/t/serial-communication-simulink/31516 "2021-08-02T16:03:17Z")

</div>

Hi, I want to send some binary data through processing serial to Matlab Simulink Software(serial receive block); I defined header and terminator in Simulink, but i dont know how to define this in processing? my code is…

---

## [Serial Communication / Arduino to Processing](https://discourse.processing.org/t/serial-communication-arduino-to-processing/31528)

<div class="topic-metadata">

**Author:** [@MJAhmadi](https://discourse.processing.org/u/MJAhmadi)\
**Replies:** 1\
**Last updated:** [August 1, 2021, 8:35pm UTC](https://discourse.processing.org/t/serial-communication-arduino-to-processing/31528 "2021-08-01T20:35:10Z")

</div>

Below is a part of my code : Serial.write(‘A’); // Print float data for (int i=0; i\<4; i++){ Serial.write(myValue1.bytes\[i\]); delay(10); } // Print terminator Serial.print(’\\n’); 3 value have been sent to serial…

---

## [Why does Processing send so many signals at once?](https://discourse.processing.org/t/why-does-processing-send-so-many-signals-at-once/31420)

<div class="topic-metadata">

**Author:** [@Adilic0](https://discourse.processing.org/u/Adilic0)\
**Replies:** 4\
**Last updated:** [July 24, 2021, 12:01pm UTC](https://discourse.processing.org/t/why-does-processing-send-so-many-signals-at-once/31420 "2021-07-24T12:01:18Z")

</div>

I am trying to make a Breakout clone game and try to connect the Arduino to control the LED when the ball hit the bricks and I wrote the codes like this void checkCollision(){ if ( ball.x \> bar.x && ball.x \< bar.x …

---

## [No data sent or shown via OSC to Processing from Muse 2](https://discourse.processing.org/t/no-data-sent-or-shown-via-osc-to-processing-from-muse-2/31283)

<div class="topic-metadata">

**Author:** [@teemee](https://discourse.processing.org/u/teemee)\
**Replies:** 1\
**Last updated:** [July 18, 2021, 7:21pm UTC](https://discourse.processing.org/t/no-data-sent-or-shown-via-osc-to-processing-from-muse-2/31283 "2021-07-18T19:21:42Z")

</div>

I am working with the Muse 2, the brain wave detector, which can send the EEG via OSC. And I am using the Mind-Monitor app to monitor data and send it via OSC. So I’m testing the data from this example Example Code I’m …

---

## [Can’t output gcode properly](https://discourse.processing.org/t/can-t-output-gcode-properly/31273)

<div class="topic-metadata">

**Author:** [@kevin123](https://discourse.processing.org/u/kevin123)\
**Replies:** 3\
**Last updated:** [July 18, 2021, 2:03pm UTC](https://discourse.processing.org/t/can-t-output-gcode-properly/31273 "2021-07-18T14:03:21Z")

</div>

I have problem that my g code execution too fast,it should read the next line until the current line completes but it didn’t. I had add some pause function but it seems not work well. It still skip the line. I use ardu…

---

## [Data from Muse 2 Headband into Processing](https://discourse.processing.org/t/data-from-muse-2-headband-into-processing/31240)

<div class="topic-metadata">

**Author:** [@marianne91](https://discourse.processing.org/u/marianne91)\
**Replies:** 1\
**Last updated:** [July 15, 2021, 2:52pm UTC](https://discourse.processing.org/t/data-from-muse-2-headband-into-processing/31240 "2021-07-15T14:52:49Z")

</div>

Hi there! Just looking for anyone with advice/info from anyone who may have used a Muse 2 Headband to send data into Processing - and best advice on how to do this? (Muse 2: Brain Sensing Headband - Technology Enhanced …

---

## [Serial.write() blocks receive when written inside draw() function](https://discourse.processing.org/t/serial-write-blocks-receive-when-written-inside-draw-function/31203)

<div class="topic-metadata">

**Author:** [@mohitSingh](https://discourse.processing.org/u/mohitSingh)\
**Replies:** 2\
**Last updated:** [July 14, 2021, 11:02am UTC](https://discourse.processing.org/t/serial-write-blocks-receive-when-written-inside-draw-function/31203 "2021-07-14T11:02:22Z")

</div>

import processing.serial.\*; //\<\>// //\<\>// //import static javax.swing.JOptionPane.\*; import controlP5.\*; import java.util.\*; import javax.swing.JOptionPane; Serial myPort; // The serial port which will be opene…

---

## [How to read multiple sensors in Processing using Arduino I2C](https://discourse.processing.org/t/how-to-read-multiple-sensors-in-processing-using-arduino-i2c/30799)

<div class="topic-metadata">

**Author:** [@Halfrican911](https://discourse.processing.org/u/Halfrican911)\
**Replies:** 27\
**Last updated:** [July 12, 2021, 6:05pm UTC](https://discourse.processing.org/t/how-to-read-multiple-sensors-in-processing-using-arduino-i2c/30799 "2021-07-12T18:05:26Z")

</div>

hello everyone ive got 2 angle sensors that read accel gyro and mag o have all the code work done on arduino and i have both sensors working and feeding data to the serial monitor so i want to get 2 seperate tracking blo…

---

## [Use potentiometer to rotate car](https://discourse.processing.org/t/use-potentiometer-to-rotate-car/31029)

<div class="topic-metadata">

**Author:** [@millionish](https://discourse.processing.org/u/millionish)\
**Replies:** 1\
**Last updated:** [July 3, 2021, 10:58pm UTC](https://discourse.processing.org/t/use-potentiometer-to-rotate-car/31029 "2021-07-03T22:58:12Z")

</div>

Hi, I’m clueless as to how to use potentiometer knob to change an object’s (eg. car) directions / angles. How do I proceed to implement the code in both processing as well as arduino?

---

## [I have a problem with coding Java](https://discourse.processing.org/t/i-have-a-problem-with-coding-java/30968)

<div class="topic-metadata">

**Author:** [@christiank79](https://discourse.processing.org/u/christiank79)\
**Replies:** 4\
**Last updated:** [June 30, 2021, 4:15pm UTC](https://discourse.processing.org/t/i-have-a-problem-with-coding-java/30968 "2021-06-30T16:15:30Z")

</div>

Hello, I have a problem with coding I want to save a picture with SVG. This is the code: import processing.serial.\*; String serialPort = "COM4"; // the name of the USB port int imageType = 1; // 0=svg, 1=png, 2=both S…

---

## [Error ProcessingAPP](https://discourse.processing.org/t/error-processingapp/30965)

<div class="topic-metadata">

**Author:** [@salam\_ub](https://discourse.processing.org/u/salam_ub)\
**Replies:** 2\
**Last updated:** [June 30, 2021, 3:16pm UTC](https://discourse.processing.org/t/error-processingapp/30965 "2021-06-30T15:16:08Z")

</div>

Dear all, Once I try Pick Serial and click Connect, I got the error message below : 19:24:16 Serial connection start: detecte serial… 19:24:16 Serial detected: COM3 19:24:16 Serial connection attempt: COM3… java.lan…

---

## [G4P NullPointerexception (Unknown Source)](https://discourse.processing.org/t/g4p-nullpointerexception-unknown-source/30961)

<div class="topic-metadata">

**Author:** [@TPMoyer](https://discourse.processing.org/u/TPMoyer)\
**Replies:** 3\
**Last updated:** [June 30, 2021, 6:53am UTC](https://discourse.processing.org/t/g4p-nullpointerexception-unknown-source/30961 "2021-06-30T06:53:47Z")

</div>

Have been getting an the worst of all possible worlds, an intermittent error, see image Application is an interface to, and will not run without being connected to, an arduino which has Grbl1.1 loaded. Full code is…

---

## [How can i send Raw Ethernet II frame?](https://discourse.processing.org/t/how-can-i-send-raw-ethernet-ii-frame/30928)

<div class="topic-metadata">

**Author:** [@particlerain](https://discourse.processing.org/u/particlerain)\
**Replies:** 1\
**Last updated:** [June 26, 2021, 7:42pm UTC](https://discourse.processing.org/t/how-can-i-send-raw-ethernet-ii-frame/30928 "2021-06-26T19:42:31Z")

</div>

Is there a possibility or even library where i can open a raw ip socket and send the pixel frame as raw ethernet data through the network in Processing? If not, how can i export the framebuffer to a “c” linux code where…

---

## [Acceleration and processing 3.0](https://discourse.processing.org/t/acceleration-and-processing-3-0/30907)

<div class="topic-metadata">

**Author:** [@Halfrican911](https://discourse.processing.org/u/Halfrican911)\
**Replies:** 3\
**Last updated:** [June 25, 2021, 7:42pm UTC](https://discourse.processing.org/t/acceleration-and-processing-3-0/30907 "2021-06-25T19:42:24Z")

</div>

Hello everyone I’m trying to figure out how to get the processing ide to understand when my sensors sees acceleration in 1 m/s to the left on the x axis that is moves left in processing I have the roll pitch and yaw I ha…

---

## [Is there a way to get runtime state for a new thread()](https://discourse.processing.org/t/is-there-a-way-to-get-runtime-state-for-a-new-thread/30840)

<div class="topic-metadata">

**Author:** [@gerrikoio](https://discourse.processing.org/u/gerrikoio)\
**Replies:** 4\
**Last updated:** [June 24, 2021, 8:55pm UTC](https://discourse.processing.org/t/is-there-a-way-to-get-runtime-state-for-a-new-thread/30840 "2021-06-24T20:55:04Z")

</div>

I am reading a byte data stream from a serial port. This data stream is from a Bluetooth LE (BLE) Scanner application, so when it’s detecting 10 more BLE devices, and their advertising data packets, we looking at a good …

---

## [Is there an associated timeout function when using Serial Buffer](https://discourse.processing.org/t/is-there-an-associated-timeout-function-when-using-serial-buffer/30886)

<div class="topic-metadata">

**Author:** [@gerrikoio](https://discourse.processing.org/u/gerrikoio)\
**Replies:** 2\
**Last updated:** [June 24, 2021, 3:19pm UTC](https://discourse.processing.org/t/is-there-an-associated-timeout-function-when-using-serial-buffer/30886 "2021-06-24T15:19:01Z")

</div>

I have been testing the Serial library buffer() function and it works very well with Serial Event. But I am left wondering what happens if the Serial port is somehow disrupted. Is there a timeout parameter somewhere tha…

---

## [Comparing serial Arduino inputs with Strings in if-statements don´t work](https://discourse.processing.org/t/comparing-serial-arduino-inputs-with-strings-in-if-statements-don-t-work/30791)

<div class="topic-metadata">

**Author:** [@Simon44](https://discourse.processing.org/u/Simon44)\
**Replies:** 4\
**Last updated:** [June 21, 2021, 11:21am UTC](https://discourse.processing.org/t/comparing-serial-arduino-inputs-with-strings-in-if-statements-don-t-work/30791 "2021-06-21T11:21:45Z")

</div>

Hello Community, I´m working on my first Arduino + Processing project. The Arduino microcontroller is built as an “roll the dice” game. When I push a button on the board random numbers between 1-6 are rolled and display…

---

## [Creating an I2C address for a RPi slave](https://discourse.processing.org/t/creating-an-i2c-address-for-a-rpi-slave/30732)

<div class="topic-metadata">

**Author:** [@TheDek](https://discourse.processing.org/u/TheDek)\
**Replies:** 1\
**Last updated:** [June 19, 2021, 9:00pm UTC](https://discourse.processing.org/t/creating-an-i2c-address-for-a-rpi-slave/30732 "2021-06-19T21:00:18Z")

</div>

I am trying to connect two Raspberry Pi’s using an I2C connection. I planned to use one as the slave sending data, and the other as the master. When I do i2cdetect -y 1 on my system the two pi’s can see each other, but n…

---

## [What is the code from the light sensor to control my waveform?](https://discourse.processing.org/t/what-is-the-code-from-the-light-sensor-to-control-my-waveform/30736)

<div class="topic-metadata">

**Author:** [@Marga](https://discourse.processing.org/u/Marga)\
**Replies:** 1\
**Last updated:** [June 15, 2021, 11:52pm UTC](https://discourse.processing.org/t/what-is-the-code-from-the-light-sensor-to-control-my-waveform/30736 "2021-06-15T23:52:09Z")

</div>

Hi, I’m having difficulties in reaching my goal, which is with the Arduino Esplora, when I point more light to the light sensor my waveform in the processing increases and when the sensor receives less this waveform disa…

---

## [How do I write a (uint8\_t) data array via serial](https://discourse.processing.org/t/how-do-i-write-a-uint8-t-data-array-via-serial/30543)

<div class="topic-metadata">

**Author:** [@gerrikoio](https://discourse.processing.org/u/gerrikoio)\
**Replies:** 4\
**Last updated:** [June 7, 2021, 6:40pm UTC](https://discourse.processing.org/t/how-do-i-write-a-uint8-t-data-array-via-serial/30543 "2021-06-07T18:40:01Z")

</div>

I am learning the hard way that in Processing a “byte” data type is -128 to 127 and that if dealing with unsigned data types like “uint8\_t” I need to use the signed integer data type. Now I am sure this question has bee…

---

## [Making a working liquid thermometer](https://discourse.processing.org/t/making-a-working-liquid-thermometer/30410)

<div class="topic-metadata">

**Author:** [@Valakas](https://discourse.processing.org/u/Valakas)\
**Replies:** 10\
**Last updated:** [June 7, 2021, 5:16pm UTC](https://discourse.processing.org/t/making-a-working-liquid-thermometer/30410 "2021-06-07T17:16:10Z")

</div>

Hello everyone. I have a code which receives a temperature and humidity value through the serial and I’m trying to use the temperature value to make a working liquid thermometer. As of right now, I managed to make it cha…

---

## [Processing + Arduino Force Sensor Visualizing](https://discourse.processing.org/t/processing-arduino-force-sensor-visualizing/30459)

<div class="topic-metadata">

**Author:** [@frzsl](https://discourse.processing.org/u/frzsl)\
**Replies:** 2\
**Last updated:** [June 4, 2021, 2:29am UTC](https://discourse.processing.org/t/processing-arduino-force-sensor-visualizing/30459 "2021-06-04T02:29:16Z")

</div>

Hi everyone! I’m working with a FSR Matrix Array from Sensitronics. I’m trying to make a basic visualizer that displays a black 16x16 grid. When force is detected on the MatrixArray, we’ll shade the corresponding grid ce…

---

## [A little problem with my code](https://discourse.processing.org/t/a-little-problem-with-my-code/30467)

<div class="topic-metadata">

**Author:** [@ilob](https://discourse.processing.org/u/ilob)\
**Replies:** 2\
**Last updated:** [June 3, 2021, 10:36am UTC](https://discourse.processing.org/t/a-little-problem-with-my-code/30467 "2021-06-03T10:36:17Z")

</div>

I have a little problem with my code, I am trying to make a project of a scara that makes figures, the code seems to be finished, but when starting the program I get the only and simple errors that are these: The file “…

---

## [Blending two images using movement sensor and arduino](https://discourse.processing.org/t/blending-two-images-using-movement-sensor-and-arduino/30404)

<div class="topic-metadata">

**Author:** [@szymon\_gl](https://discourse.processing.org/u/szymon_gl)\
**Replies:** 1\
**Last updated:** [May 31, 2021, 11:10pm UTC](https://discourse.processing.org/t/blending-two-images-using-movement-sensor-and-arduino/30404 "2021-05-31T23:10:04Z")

</div>

Hi, I need help with an art project I am trying to finish. I want to smoothly blend two images together (the backgroung image it’s a photo of a person and the second image is the same person but wearing a mask). I want …

---

## [FFT of 1D array of 1024 measurements](https://discourse.processing.org/t/fft-of-1d-array-of-1024-measurements/7901)

<div class="topic-metadata">

**Author:** [@jlodewey](https://discourse.processing.org/u/jlodewey)\
**Replies:** 19\
**Last updated:** [May 31, 2021, 7:21pm UTC](https://discourse.processing.org/t/fft-of-1d-array-of-1024-measurements/7901 "2021-05-31T19:21:05Z")

</div>

Hello Is there a function such as fft(array)? The array input comes from an Arduino. The sound library contains an FFT possibility but the input comes from an audio input. Thank you. Jozef lodeweyckx

---

## [Trouble receiving different data through serial from Arduino to Processing](https://discourse.processing.org/t/trouble-receiving-different-data-through-serial-from-arduino-to-processing/30317)

<div class="topic-metadata">

**Author:** [@Valakas](https://discourse.processing.org/u/Valakas)\
**Replies:** 5\
**Last updated:** [May 30, 2021, 3:23pm UTC](https://discourse.processing.org/t/trouble-receiving-different-data-through-serial-from-arduino-to-processing/30317 "2021-05-30T15:23:06Z")

</div>

Hello everyone, this is my first time using both processing and arduino and I’m having a bit of trouble with receiving data in processing. I have a DHT11 temperature and humidity sensor I’m using with my Arduino and I’m…

---

## [Servo turn opposite direction](https://discourse.processing.org/t/servo-turn-opposite-direction/30166)

<div class="topic-metadata">

**Author:** [@doni](https://discourse.processing.org/u/doni)\
**Replies:** 5\
**Last updated:** [May 25, 2021, 2:36pm UTC](https://discourse.processing.org/t/servo-turn-opposite-direction/30166 "2021-05-25T14:36:35Z")

</div>

hi forum. i was able to track the object coordinate in the screen/lcd based on color and plan to direct the middle camera attached to pantilt arm every time the object moves. but the result is the horizontal servo always…

[Previous page](https://discourse.processing.org/c/processing/processing-electronics/25.md?page=7)

[Next page](https://discourse.processing.org/c/processing/processing-electronics/25.md?page=9)
