Go Down

Topic: Send data to Teensy3.6 using Java (Read 3486 times) previous topic - next topic

horace

You are still allocating a one element array uselessly.

Why can't you just:
Code: [Select]
        byte val = (byte)event.getCharacter().charAt(0);
        comPort.writeBytes(val, 1);

give an error
Code: [Select]
\FXMLDocumentController.java:28: error: incompatible types: byte cannot be converted to byte[]
        comPort.writeBytes(val, 1);


Quote
You might need to lie to the function:
Code: [Select]
        byte val = (byte)event.getCharacter().charAt(0);
        comPort.writeBytes(&val, 1);

Java does not have the address of operator &
Code: [Select]
FXMLDocumentController.java:28: error: illegal start of expression
        comPort.writeBytes(&val, 1); }

Xeyow

And you guys... just messed up my head :)) I`m glad to see people giving me clues and tips! So keep it going! It helps a lot!

Go Up