user43364: #define ANALOG_IN 0



void setup() {

  Serial.begin(19200);

  analogReference(INTERNAL);

}



void loop() {

  int val = analogRead(ANALOG_IN);

  Serial.print(0xff, byte);

  Serial.print( (val >> 8) & 0xff, byte);

  Serial.print( val & 0xff, byte);



}

This is my code and I'm getting this error for all 3 Serial.print commands. Please help.

user10794: Why are you putting byte there? That isn't in the Serial.print reference page.
This compiles OK:
#define ANALOG_IN 0

void setup() {
  Serial.begin(19200);
  analogReference(INTERNAL);
}

void loop() {
  int val = analogRead(ANALOG_IN);
  Serial.print(0xff);
  Serial.print( (val >> 8) & 0xff);
  Serial.print( val & 0xff);
}


43364: <pre><code>#define ANALOG_IN 0



void setup() {

  Serial.begin(19200);

  analogReference(INTERNAL);

}



void loop() {

  int val = analogRead(ANALOG_IN);

  Serial.print(0xff, byte);

  Serial.print( (val &gt;&gt; 8) &amp; 0xff, byte);

  Serial.print( val &amp; 0xff, byte);



}
</code></pre>

<p>This is my code and I'm getting this error for all 3 Serial.print commands. Please help.</p>
 10794: <p>Why are you putting <code>byte</code> there? That isn't in the <a href="https://www.arduino.cc/reference/en/language/functions/communication/serial/print/" rel="nofollow noreferrer">Serial.print reference page</a>.</p>

<p>This compiles OK:</p>

<pre><code>#define ANALOG_IN 0

void setup() {
  Serial.begin(19200);
  analogReference(INTERNAL);
}

void loop() {
  int val = analogRead(ANALOG_IN);
  Serial.print(0xff);
  Serial.print( (val &gt;&gt; 8) &amp; 0xff);
  Serial.print( val &amp; 0xff);
}
</code></pre>
