laptophead
Well-known member
I am trying to transmit 9 Variables from one teensy to another using the Serial port 1.
I think I got the hardware part right , I connected the Pin 1 of the transmitting Teensy to the pin 0 of the receiving one.
Than I tried the example of this blog https://www.pjrc.com/teensy/td_serial.html
Transmitter code is
int number = 1234;
Serial.println("string"); // string
Serial1.println('a'); // single character
Serial1.println(number); // number (base 10 if 16 or 32 bit)
Serial1.println(number, DEC); // number, base 10 (default)
Serial1.println(number, HEX); // number, base 16/hexidecimal
Serial1.println(number, OCT); // number, base 8/octal
Serial1.println(number, BIN); // number, base 2/binary
Serial1.println(number, BYTE); // number, as a single byte
Serial1.println(3.14); // number in floating point, 2 digits
And the receiver code is
if (Serial1.available()) {
incomingByte = Serial1.read(); // will not be -1
//Serial.println(incomingByte);
}
// Serial.println("SerialWorks");
Serial.println(incomingByte);
When I monitor the incomingByte , all I see is 2 digit numbers repeating, but nothing resembling what was sent.
How to I parse these values? How do I get to see them for what was sent?
How do I make new integers that equal each of them, so I can use them??
Thanks
I think I got the hardware part right , I connected the Pin 1 of the transmitting Teensy to the pin 0 of the receiving one.
Than I tried the example of this blog https://www.pjrc.com/teensy/td_serial.html
Transmitter code is
int number = 1234;
Serial.println("string"); // string
Serial1.println('a'); // single character
Serial1.println(number); // number (base 10 if 16 or 32 bit)
Serial1.println(number, DEC); // number, base 10 (default)
Serial1.println(number, HEX); // number, base 16/hexidecimal
Serial1.println(number, OCT); // number, base 8/octal
Serial1.println(number, BIN); // number, base 2/binary
Serial1.println(number, BYTE); // number, as a single byte
Serial1.println(3.14); // number in floating point, 2 digits
And the receiver code is
if (Serial1.available()) {
incomingByte = Serial1.read(); // will not be -1
//Serial.println(incomingByte);
}
// Serial.println("SerialWorks");
Serial.println(incomingByte);
When I monitor the incomingByte , all I see is 2 digit numbers repeating, but nothing resembling what was sent.
How to I parse these values? How do I get to see them for what was sent?
How do I make new integers that equal each of them, so I can use them??
Thanks