Pages: [1]   Go Down
Author Topic: How to replace Byte in serial command  (Read 750 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 0
Posts: 112
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I have this code line in one of the example codes for the GPRS shield.

Code:

GPRS_Serial.print(0x1A,BYTE);

[\code]

This byte word is no longer supported by Arduino 1.0. Can I use just the below mentioned code for the same functionality.

[code]

GPRS_Serial.print(0x1A);

[\code]
[/code]
Logged

UK
Offline Offline
Faraday Member
**
Karma: 99
Posts: 4153
Where is your SSCCE?!?!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What is the output supposed to look like?

You can caste the value to anything you like (within reason) with:

Code:
Serial.print((byte)0x1A);

(by the way, the terminating tags use / not \)
Logged

Get 10% off all 4D Systems TFT screens this month: use discount code MAJENKO10

Germany
Offline Offline
Faraday Member
**
Karma: 57
Posts: 3005
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sending a raw byte is done with
    GPRS_Serial.write(0x1A);
Logged

Pages: [1]   Go Up
Jump to: