![]() |
![]() |
![]() |
|
|
|||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
|
|
Thread Tools | Display Modes |
|
|
(permalink) |
|
Dumb question I'm sure, but how do I display a degree symbol ($df) on my LCD? I format my output with sprintf.
Code:
sprintf(string,"Temp: %u°C",an2);
__________________
========================= Futz's Microcontrollers & Robotics ========================= Last edited by futz; 30th May 2008 at 03:00 AM. |
|
|
|
|
|
|
(permalink) |
|
It's 223 decimal on a typical LCD.
|
|
|
|
|
|
|
(permalink) |
|
Yes, $df = 223. That's why I mentioned it in my op. But I can't figure out how to get it displayed with sprintf. Sourceboost's sprintf is a little bit non-standard, and their docs on it aren't very thorough.
In assembler it would be very simple.
__________________
========================= Futz's Microcontrollers & Robotics ========================= Last edited by futz; 30th May 2008 at 03:16 AM. |
|
|
|
|
|
|
(permalink) |
|
ASCII degree symbol is 248, can you type <alt> 0223 in the quotes?
|
|
|
|
|
|
|
(permalink) | |
|
Quote:
EDIT: Whoops! 248 ($f8) does not work. I get a lowercase x with an "overscore" above it. I fumbled on a way to do it. Had to split the line up into three separate outputs, but it works now. Code:
sprintf(string,"Temp: %u",an2); lcd_string(string); sprintf(string,"\xdf",0); lcd_string(string); sprintf(string,"C",0); lcd_string(string);
__________________
========================= Futz's Microcontrollers & Robotics ========================= Last edited by futz; 30th May 2008 at 03:28 AM. |
||
|
|
|
|
|
(permalink) | |
|
Quote:
__________________
========================= Futz's Microcontrollers & Robotics ========================= Last edited by futz; 30th May 2008 at 03:32 AM. |
||
|
|
|
|
|
(permalink) | |
|
Quote:
Code:
sprintf(string,"Temp: %u\xdf",an2); lcd_string(string); sprintf(string,"C",0); lcd_string(string);
__________________
========================= Futz's Microcontrollers & Robotics ========================= Last edited by futz; 30th May 2008 at 03:46 AM. |
||
|
|
|
|
|
(permalink) |
|
You must type <alt> 223 on the number pad if I recall. Sometimes you need the leading zero. I've not used the method for ages.
PS I see on your site you've got one of dipmicros ICD2 clones, I wonder how Roman's going to make it 3.3V as it looks about the same as the Inchworm. On a sidenote you can simply connect the Inchworm+ or Junebug to any 3.3V PIC as long as it has it's own 3.3V power supply and the PGC / PGD pins don't have analog. Last edited by blueroomelectronics; 30th May 2008 at 04:18 AM. |
|
|
|
|
|
|
(permalink) |
|
223 is correct but with the alt method I think it depends on the font in windows. I know in windows you do need the leading zero, but they made a mess of the good old ascii table.lol I can use a 0176 to make this -->° Did I ever tell you I hate windows?..lol
-BaC
__________________
Error: {Panic!} when trying to load: [reality shell]. kernel: "universe has been halted"... Information Underground |
|
|
|
|
|
|
(permalink) | |
|
Quote:
Code:
sprintf(string,"Temp: %u\223C",an2);
__________________
========================= Futz's Microcontrollers & Robotics ========================= |
||
|
|
|
|
|
(permalink) |
|
The 223 is strictly for the LCD, it'll show up as who knows what in XP but the LCD should be happy.
Edit: glad it's working futz, plenty of smart folks hang around here. Nicely done BaCarDi Last edited by blueroomelectronics; 30th May 2008 at 04:35 AM. |
|
|
|
|
|
|
(permalink) |
|
OOps I deleted this by mistake!..lmao
I'll put it back to make sense of your post futz, glad it worked out ----------------------------------------------------------- I original said: I just looked through the manual a bit does this work? Code:
sprintf(string,"Temp: %u\223",an2);
__________________
Error: {Panic!} when trying to load: [reality shell]. kernel: "universe has been halted"... Information Underground Last edited by BaCaRdi; 30th May 2008 at 04:37 AM. |
|
|
|
|
|
|
(permalink) |
|
Yes but if your in windows trying the alt method that is exactly what you would get
Cheers Blue -BaC
__________________
Error: {Panic!} when trying to load: [reality shell]. kernel: "universe has been halted"... Information Underground Last edited by BaCaRdi; 30th May 2008 at 04:39 AM. |
|
|
|
|
|
|
(permalink) | |
|
Quote:
__________________
========================= Futz's Microcontrollers & Robotics ========================= |
||
|
|
|
|
|
(permalink) |
|
OK now I am really curious, I'll bite and click the link..hehe
Ahhh I remember these days, now I will have to read up for a while..lol EDIT: Ok now I need to start using c again too...lol Damn that learning curve! I really like that 2-wire LCD interface! -BaC
__________________
Error: {Panic!} when trying to load: [reality shell]. kernel: "universe has been halted"... Information Underground Last edited by BaCaRdi; 30th May 2008 at 05:17 AM. |
|
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Latest |
| College Degree: A Complete Waste so far | DigiTan | Chit-Chat | 150 | 11th August 2008 06:14 PM |
| math.h and lib for BoostC? | futz | Micro Controllers | 3 | 31st March 2008 05:29 AM |
| Symbol ? | ATSRND | General Electronics Chat | 1 | 9th January 2008 03:04 AM |
| Final Year Electronics Degree Project | rgraj | Electronic Projects Design/Ideas/Reviews | 2 | 25th March 2006 04:18 PM |
| What does this symbol mean? | DJ_ReL@X! | General Electronics Chat | 6 | 24th October 2004 12:00 AM |