Pages: [1]   Go Down
Author Topic: 'BYTE' keyword is no longer supported  (Read 3818 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 71
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi guys,

I am trying to compile the following code:

Code:
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,
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 631
Posts: 50155
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: