Ko de Beer
Member
Heyy
For my newest project I need to send sensor value from my Teensy 3.6 to my Adafruit HUZZAH.
But as it is I am only receiving a value of 0 on the HUZZAH.
It should be a value going from 0 to 1023.
These are the codes I'm using right now:
Teensy 3.6 code:
HUZZAH code:
Thank you for reading,
Please let me know if you have any clue what I should change
For my newest project I need to send sensor value from my Teensy 3.6 to my Adafruit HUZZAH.
But as it is I am only receiving a value of 0 on the HUZZAH.
It should be a value going from 0 to 1023.
These are the codes I'm using right now:
Teensy 3.6 code:
Code:
void setup() {
// put your setup code here, to run once:
Serial1.begin (115200);
Serial.begin (115200);
}
void loop() {
// put your main code here, to run repeatedly:
static int number = 0;
Serial1.write(highByte(number));
Serial1.write(lowByte(number));
number ++;
if (number == 1024);
number = 0;
delay(100);
}
HUZZAH code:
Code:
void setup() {
// put your setup code here, to run once:
Serial1.begin (115200);
Serial.begin (115200);
}
void loop() {
// put your main code here, to run repeatedly:
byte highByte , lowByte;
int value;
highByte = Serial.read();
lowByte = Serial.read();
value = (highByte << 8) | lowByte ;
Serial.println (value);
delay (1000);
}
Thank you for reading,
Please let me know if you have any clue what I should change