Pages: [1]   Go Down
Author Topic: Software serial help  (Read 359 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, i´m having some problems with this.
I controling a serial lcd, and I need to set character position, in hardware serial I use Serial.write(254);  Serial.write(202);   to write special characters, but this is not suported by software serial, how can I write this as a single byte and not "254" in text


Tanks smiley
Logged

Bristol, UK
Offline Offline
Edison Member
*
Karma: 1
Posts: 1197
Exhibitor at UK Maker Faire
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Could you make a two-character string, set the first character (byte) to the value you need, and print a string?

Code:
char str[2];

str[0] = 254;
str[1] = '\0';

// Send 'str' to the LCD
Logged

The Big Smoke
Offline Offline
Sr. Member
****
Karma: 0
Posts: 260
Hacking and Slashing
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

...That or you should be able to define the data type as per the reference manual matey


Serial.write(mydata,datatype[DEC|BYTE|etcetc]);
Logged

Pages: [1]   Go Up
Jump to: