Serial communication
in
Core Library Questions
•
11 months ago
Hello everyody. I'm trying to communicate my serial an integer DTIME (read from dtime.txt) to my Arduino.
I've no error message, but this still doesn't work! Somebody help me please..
Here's the sketch:
1. import processing.serial.*;
2. Serial myPort;
3. void setup () {
4.
5. String portName = Serial.list()[0];
6. myPort = new Serial(this, portName, 9600);
7. }
8. void FileToSerial() {
9. String [] strLines = loadStrings("dtime.txt");
10. for (int i=0; i<strLines.length; i++) {
11. int DTIME = int (strLines[i]);
12. myPort.write (DTIME);
13. }
14. }
Thank you so much,
Mario.
I've no error message, but this still doesn't work! Somebody help me please..
Here's the sketch:
1. import processing.serial.*;
2. Serial myPort;
3. void setup () {
4.
5. String portName = Serial.list()[0];
6. myPort = new Serial(this, portName, 9600);
7. }
8. void FileToSerial() {
9. String [] strLines = loadStrings("dtime.txt");
10. for (int i=0; i<strLines.length; i++) {
11. int DTIME = int (strLines[i]);
12. myPort.write (DTIME);
13. }
14. }
Thank you so much,
Mario.
1