I am trying to display the character chosen from the array
char CW_char;
.
char message[] = "aaaaa bbbbb ccccc ddddd eeeee "; Note the underline is not present in code. It is mispelled.
This line works.
RIT128x96x4StringDraw("CW Generation Running", 18, 24, 15);
for(i=0;i<=30;i++)
{
CW_char = message[i];
switch (CW_char)
This is the problem line
RIT128x96x4StringDraw(CW_char, 18, 40, 15);
________________________________________________________________
Description Resource Path Location Type
argument of type "char" is incompatible with parameter of type "const char *" main.c /CW_LM_2 line 400 C/C++ Problem
How do I fix it. It ia already a pointer since it is an array.
MartinPottsIt ia already a pointer since it is an array.
No, it isn't!
Look again:
That's just a plain 'char' - not an array!
But number{1} gets tyhe same result
RIT128x96x4StringDraw(message[i], 18, 40, 15);
Description Resource Path Location Type argument of type "char" is incompatible with parameter of type "const char *" main.c /CW_LM_2 line 711 C/C++ Problem
RIT128x96x4StringDraw(*CW_char, 18, 40, 15);
Description Resource Path Location Type operand of "*" must be a pointer main.c /CW_LM_2 line 711 C/C++ Problem
So what do I put here to put the selected character here.
RIT128x96x4StringDraw( ????? , 18, 40, 15);
MartinPottsBut number{1} gets tyhe same result
Of course it does! Because you are still providing a single char, when the function prototype requires a pointer to a char!
MartinPottsRIT128x96x4StringDraw(message[i], 18, 40, 15);
Again, message[i] is a single element - a char - from the array.
MartinPottsSo what do I put here to put the selected character here.
You can't!
As the name suggests, RIT128x96x4StringDraw prints a string - not a char!
To get it to print a single character, you will have to build a 1-character string.
Note that this is all basic 'C' stuff - nothing specifically to do with TI or Stellaris.
Sorry. But it fortifies my observations. TI software it for software techies and not for engineers who want to develope processes.
Feel your pain... Suspect that somewhere a "software techie" likewise proclaims, "TI MCUs are for engineers - not for software techies who want to develop processes..."
I would doubt that any of your process manuals are as broadly based - and as well described & detailed - as StellarisWare. Perfect - no - but you're surely smart/resourceful enough to resolve the display issue presented... And you did get repeated, instant response - for free - from dreaded software techie!
Thus TI cannot win.... and mkt guy/gal slowly raises pistol to head... (and process vendor - who ignored display - escapes unscathed... (except for here)
MartinPottsTI software it for software techies and not for engineers who want to develope processes.
Again, this is all basic 'C' stuff - nothing specifically to do with TI or Stellaris.
Obviously, to develop "processes" with any software content, you need to have or acquire suitable software competences.
Exactly the same way that, to develop "processes" with any electronics content, you need to have or acquire suitable electronics competences;
Or, to develop "processes" with any mechanical content, you need to have or acquire suitable mechanical competences;
etc, etc, etc,...
MartinPotts wrote the following post at 9 May 2012 9:36 AM:
Maybe you meant to say that TI software is for another topic... because you're talking about C instead - a (largely hardware agnostic) language which has been around since the early 70's and is extensively used in micro's right across the range of manufacturers - and the mere fact that TI provides a C compiler and all these handy API's (like the RIT128x96x4.c one you're referring to here) is a godsend, because without it you'd be writing all that code in assembly - and if you don't understand C then you'll never understand assembly.
You might want to clarify the word 'engineer' tho - are you a civil engineer? Because I wouldn't expect you to know C in that case... but if you're an electrical / electronics engineer and you're serious about using micros then you should be able to pick up C well enough to use it... just don't blame the micro or its manufacturer for the shortcomings in your understanding - especially after people here have helped you solve the problem.
Steve
Steve D.if you're ... serious about using micros ...
The whole point of microcontrollers is precisely that they allow you to do stuff in software without having to design specific, custom hardware for the particular task at hand.
cb1_mobile Suspect that somewhere a "software techie" likewise proclaims, "TI MCUs are for engineers - not for software techies who want to develop processes..."
I seem to recall just such a post on another forum years ago: a "software techie" whingeing about how hard it was to use a 555 timer - with all those resistors, capacitors, and complicated (sic) formulae to deal with...
Mine was a (hoped for) play on words (via reversal) - to further illustrate the emptiness of complainant's position. Credited you with multiple, instant responses.
Mind was made up - simple facts had little impact... As past proclaimed, "StellarisWare RULES - Long live StellarisWare!"
yes I solved the problem with a simple statement.
sprintf(buf, "%c " , message[i]) ; RIT128x96x4StringDraw(buf , 18, 80, 15);
I know that the solution is not recommended by true professional C++ programmers but it works fine.
Why did someone not suggest that solution? Would have save a lot of band bits.
MartinPottsWhy did someone not suggest that solution?
I did:
Andy NeilTo get it to print a single character, you will have to build a 1-character string.