Pages: [1]   Go Down
Author Topic: How to replace Byte in serial command  (Read 633 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: 92
Posts: 3969
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

Why not visit my eBay shop? http://stores.ebay.co.uk/Majenko-Technologies
Replacement for the Arduino IDE: UECIDE - Proper serial terminal, graphing facilities, plugins, overhauled internals.
Java isn't bad in itself, but it has enabled morons to write programs.

Germany
Offline Offline
Faraday Member
**
Karma: 49
Posts: 2741
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: