Loading...
Pages: [1]   Go Down
Author Topic: How to replace Byte in serial command  (Read 296 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
Edison Member
*
Karma: 45
Posts: 2259
What a host of balls she had seen: gaity, the brass buttons...
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


Germany
Offline Offline
Edison Member
*
Karma: 27
Posts: 1507
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1]   Go Up
Print
 
Jump to: