Difference between revisions of "Pure Data"
From Digipool-Wiki
(→Download both files as Zip) |
(→Full Serial Connection to Arduino) |
||
(9 intermediate revisions by the same user not shown) | |||
Line 7: | Line 7: | ||
== Screenshot of the PD-Patch == | == Screenshot of the PD-Patch == | ||
− | [[File:Pure-Data Easy-Serial-Connection-to-Arduino.png| | + | [[File:Pure-Data Easy-Serial-Connection-to-Arduino.png|550px]] |
Line 35: | Line 35: | ||
[[Media:PD-ArduinoSimpleSerial.zip|PD-ArduinoSimpleSerial.zip]] | [[Media:PD-ArduinoSimpleSerial.zip|PD-ArduinoSimpleSerial.zip]] | ||
+ | |||
+ | <br> | ||
+ | |||
+ | |||
+ | = Full Serial Connection to Arduino = | ||
+ | |||
+ | This patch is based on [https://drymonitis.me/ Alexandros Drymonitis's] code and works ideally to receive multiple data streams from the Arduino in full perfection with Pure Data. | ||
+ | |||
+ | A clearer, more structured patch and a tutorial are still work in progress. | ||
+ | |||
+ | <br> | ||
+ | |||
+ | == Screenshot of the PD-Patch == | ||
+ | |||
+ | [[File:Full-Serial-Connection-Pure Data-Arduino.png]] | ||
+ | |||
+ | <br> | ||
+ | |||
+ | == Arduino Code == | ||
+ | |||
+ | <pre> | ||
+ | |||
+ | void setup() { | ||
+ | Serial.begin(9600); | ||
+ | } | ||
+ | |||
+ | void loop() { | ||
+ | int sensorValue1 = analogRead(A0); | ||
+ | int sensorValue2 = analogRead(A1); | ||
+ | Serial.print(sensorValue1); | ||
+ | Serial.print(" "); | ||
+ | Serial.print(sensorValue2); | ||
+ | Serial.println(); | ||
+ | delay(100); | ||
+ | } | ||
+ | |||
+ | </pre> | ||
+ | |||
+ | <br> | ||
+ | |||
+ | == Download both files as Zip == | ||
+ | |||
+ | [[Media:Arduino-PureData-Serial.zip|Arduino-PureData-Serial.zip]] | ||
<br> | <br> |
Latest revision as of 22:22, 2 January 2025
Contents
Easy Serial Connection to Arduino
The fastest and easiest way to receive Arduino (sensor) data with PD.
Screenshot of the PD-Patch
Arduino Code
void setup() { Serial.begin(9600); } void loop() { int sensorValue = analogRead(A0); int sendValue = map(sensorValue, 0, 1024, 0, 255); Serial.write(sendValue); delay(100); }
Download both files as Zip
Full Serial Connection to Arduino
This patch is based on Alexandros Drymonitis's code and works ideally to receive multiple data streams from the Arduino in full perfection with Pure Data.
A clearer, more structured patch and a tutorial are still work in progress.
Screenshot of the PD-Patch
Arduino Code
void setup() { Serial.begin(9600); } void loop() { int sensorValue1 = analogRead(A0); int sensorValue2 = analogRead(A1); Serial.print(sensorValue1); Serial.print(" "); Serial.print(sensorValue2); Serial.println(); delay(100); }
Download both files as Zip