Go Down

Topic: HOW TO SEND HEX VALUE FROM PROCESSING TO ARDUINO THROUGH SERIAL (Read 957 times) previous topic - next topic

SureshKumar2610

Processing code

Code: [Select]

void setup()
{
  size(200, 200);
  myPort = new Serial(this, "COM6", 57600);
}
 
void draw() {
  fill(value,0,255);
  rect(25, 25, 50, 50);
}
 
void mouseClicked() {
  if (value == 0) {
    value = 255;
    for(int i=0;i<=11;i++){
      myPort.write(collect[i]);
    }
  } else {
    value = 0;
  }
}


Arduino code

Code: [Select]

#include <SoftwareSerial.h>
SoftwareSerial mySerial(2,3);

void setup(){
 Serial.begin(57600);
 mySerial.begin(57600);
}
 
void loop(){
 while (Serial.available()){
  uint8_t byts=Serial.read();
  mySerial.write(byts);
 }
}


I got error like this iyyyy iyyyy iyyyy

even if i send single byte like this 0xEF i got 'i;'

I also checked different baud rates no improvement

For viewing purpose I am using software serial and this 2,3 pins are connected with my CP2102 USB to TTL with different port(COM3).
Arduino nano connected with COM6 for upload the code. after uploading I run the processing sketch. because this is using COM6 port.

Please find the attachment.
My YouTube Channel "Arduino Enthu"

nickgammon

Quote
HOW TO SEND HEX VALUE FROM PROCESSING TO ARDUINO THROUGH SERIAL
I have already asked you to stop shouting at us:

HOW TO SEND HEX VALUES FROM PROCESSING THROUGH SERIAL

You are still doing it.

Ok. I am not going to use JI word.

But I am always giving respect to you people. that is it,
It is disrespectful to shout at people. Do you shout at your teachers?

Please do not cross-post. This wastes time and resources as people attempt to answer your question on multiple threads.

Thread locked.

- Moderator
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

Go Up