Go Down

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


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:

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?



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.
The art of getting good answers lies in asking good questions.

Go Up