Hi new to arduino and after bit of help. ![]()
Im looking to control a kramer video switch via the arduino's serial port.
I need to send some acsii characters above the normal 127 range.
from 129 to 137
any examples or help would be great.
Hi new to arduino and after bit of help. ![]()
Im looking to control a kramer video switch via the arduino's serial port.
I need to send some acsii characters above the normal 127 range.
from 129 to 137
any examples or help would be great.
any examples or help would be great.
OK.
byte val = 150;
Serial.write(val);
You may wish to rephrase the question - as ASCII is a 7-bit code and by definition ranges 0 -127.
Check out www.asciitable.com also, for extended ACII codes.
byte val = 150;
Serial.write(val);
is how im doing it but for below
decimal
129 0x81= blank space
130 or hex 0x82 = ,
131 or hex 0x83 = f
anythin in the range 0 to 127 works above that just goes to pot
above that just goes to pot
What goes to pot?
You asked how to send the values. I told you that. It is up to the other end of the serial connection to deal with the extended ASCII character set correctly.
Are we to assume that "goes to pot" means that the receiving end does not deal with extended ASCII in the way that you imagined it would?
alreay tried this
byte val = 150;
Serial.write (val);
works ok for values 0 to 127 but not for values above that, the output im seeing using the serial monitor or termainal window to monitor the serial data does not match the extended ascii table
decimal hex
129 0x81 = blank space
130 0x82 = ,
131 0x83 = curly f
the output im seeing using the serial monitor or termainal window to monitor the serial data does not match the extended ascii table
So is that not a problem with the terminal window? How do you know it is mapped to the extended ASCII set?
This is what I get with this code:-
// extended ASCII test
void setup(){
 Serial.begin(9600);
  for(int i= 0x30; i<255; i++){
  if( (i & 0xf) == 0) Serial.println(" ");
  Serial.write(i);
 }
}
void loop(){
}

If you're working in a Windows environment then anything you do involving extended ASCII sets will be dependent on the current code page selection. There are lots and lots of different 'standard' definitions for what the extended ascii characters represent, and the sender and receiver need to agree what definition they're using. If you want a general solution, you might want to look at UTF8 Unicode encoding or something like that instead.