Go Down

Topic: 'BYTE' keyword is no longer supported (Read 4248 times) previous topic - next topic

cmd1024

Hi guys,

I am trying to compile the following code:

Code: [Select]
int sensorPin = 0; // Select input pin
int val = 0;
void setup() {
Serial.begin(9600); // Open serial port
}
void loop() {
val = analogRead(sensorPin)/4; // Read value from sensor
Serial.println(val,BYTE); // Print variable to serial port
delay(100); // Wait 100 milliseconds
}


It gives the following error:

Quote
As of Arduino 1.0, the 'BYTE' keyword is no longer supported.
Please use Serial.write() instead.

I have to send val to Processing in byte format.

How can I modify my code?

Thanks,

PaulS

Quote
How can I modify my code?

I'd strongly suggest that you do as told, and use Serial.write() instead.

You can search the forum for the other 800 posts asking the same question.

Go Up