Okay so I tried your special characters using this code:
string text = "àèìòù€äöüñ"; // "Starting Up!"; buffer = Encoding.UTF8.GetBytes(text); sPort.Write(buffer, 0, buffer.Length); // Write to LCD
and it produces klingon!!!!

Here is a screenshot
![]() |
  | |||||||||||||
![]() |
|
![]() |
||||||||||||
The Netduino forums have been replaced by new forums at community.wildernesslabs.co.
This site has been preserved for archival purposes only
and the ability to make new accounts or posts has been turned off.
Community Stats
0
Neutral
User ToolsFriendswaxie hasn't added any friends yet. Posts I've MadeIn Topic: Help with Serial LCD displaying gobbly-de-gop!04 September 2011 - 06:45 AM
Hi there.
Okay so I tried your special characters using this code: string text = "àèìòù€äöüñ"; // "Starting Up!"; buffer = Encoding.UTF8.GetBytes(text); sPort.Write(buffer, 0, buffer.Length); // Write to LCD and it produces klingon!!!! ![]() Here is a screenshot In Topic: Help with Serial LCD displaying gobbly-de-gop!02 September 2011 - 09:20 AM
Hi Mario. I am at work at the moment but when I get back home tonight I will test your sample chracters and see what is displayed on the LCD and report back. In Topic: Help with Serial LCD displaying gobbly-de-gop!02 September 2011 - 06:17 AM
Just for completness here is my code now which fully works! Thanks again.
using System; using System.Net; using System.Net.Sockets; using System.Threading; using Microsoft.SPOT; using Microsoft.SPOT.Hardware; using SecretLabs.NETMF.Hardware; using SecretLabs.NETMF.Hardware.NetduinoPlus; using System.IO.Ports; using System.Text; namespace NetduinoPlusApplicationLCDTest4 { public class Program { public static void Main() { // write your code here SerialPort sPort = new SerialPort(SerialPorts.COM1, 9600, Parity.None, 8, StopBits.One); sPort.Open(); byte[] buffer = null; string text = "Starting Up!"; buffer = Encoding.UTF8.GetBytes(text); sPort.Write(buffer, 0, buffer.Length); // Write to LCD Thread.Sleep(3000); // Now lets clear display! sPort.Write(new byte[] { 0x00FE, 0x01 }, 0, 2); // Write to LCD while (true) { text = "hello "; buffer = Encoding.UTF8.GetBytes(text); sPort.Write(buffer, 0, buffer.Length); // Write to LCD Thread.Sleep(500); text = "Netduino"; buffer = Encoding.UTF8.GetBytes(text); sPort.Write(buffer, 0, buffer.Length); // Write to LCD Thread.Sleep(500); // Now lets clear display! sPort.Write(new byte[] { 0x00FE, 0x01 }, 0, 2); // Write to LCD Thread.Sleep(500); } Thread.Sleep(Timeout.Infinite); } } } In Topic: Help with Serial LCD displaying gobbly-de-gop!01 September 2011 - 10:38 AM
Thanks for this info Mario and thanks for helping me with my problem. In Topic: Help with Serial LCD displaying gobbly-de-gop!01 September 2011 - 09:17 AM
Oh fiddlesticks!! Ive spent ages rubbing my noggin on this and your code looks ever so simple! Thank you for pointing me in the right direction. Like I say I am new to all of this and so its all one big learning curve. I will have to check this out when I get home tonight. While I have got your ear can I ask you a question about the digital ports. I thought that these ports could only be used to send/recieve a 1 or a 0. (true/false) but in this example you are able to use Digital Input port 0 and write characters to it. Is this because you are using the SerialPort class instead of the OutputPort/InputPort classes?
| ||||||||||||||
![]() |
||||||||||||||
![]() |
|
![]() |
||||||||||||
![]() |
This webpage is licensed under a Creative Commons Attribution-ShareAlike License. | ![]() |
||||||||||||
![]() |