Hi guys,
I have a serial device connected to the PIC USART. This devive expects commands that are very short and have no real meaning.
For example; the command to litght-up a digit is 'bn0'.
This has no real meaning and i would like to substitute it with 'Digit0'.
So that when i send 'Digit0' over the USART it will transmit insted 'bn0'.
Is this possible?
I started to think something like;
#Define bn0 = Digit0
But when i do; USART.Write(Digit0), i encounter errors for obvious rasons.
Can you help please?
Regards
Francesco
How can you substitute a string on USART output?
Moderators: David Barker, Jerry Messina
-
- Posts: 41
- Joined: Thu Feb 26, 2009 6:54 pm
- Location: UK
what about simply using constant strings:
Code: Select all
const Digit0 ="bn0"
//... and in your code
USART.Write(Digit0) // will now send the string "bn0"
-
- Posts: 41
- Joined: Thu Feb 26, 2009 6:54 pm
- Location: UK