![]() | ![]() | ![]() |
| |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
![]() |
| | Tools |
| | #1 |
|
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 04:01 AM. | |
| |
| | #2 |
|
It's 223 decimal on a typical LCD.
| |
| |
| | #3 |
| 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 04:16 AM. | |
| |
| | #4 |
|
ASCII degree symbol is 248, can you type <alt> 0223 in the quotes?
| |
| |
| | #5 | |
| 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 04:28 AM. | ||
| |
| | #6 | |
| Quote:
__________________ ========================= Futz's Microcontrollers & Robotics ========================= Last edited by futz; 30th May 2008 at 04:32 AM. | ||
| |
| | #7 | |
| 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 04:47 AM. | ||
| |
| | #8 |
|
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 05:18 AM. | |
| |
| | #9 |
|
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[888] "while trying to load":[reality.sh] kernel: [Panic!]...{Universe has been Modified!}... | |
| |
| | #10 | |
| Quote:
Now it fits all on one line again. Excellent!Code: sprintf(string,"Temp: %u\223C",an2);
__________________ ========================= Futz's Microcontrollers & Robotics ========================= | ||
| |
| | #11 |
|
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 05:35 AM. | |
| |
| | #12 |
|
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[888] "while trying to load":[reality.sh] kernel: [Panic!]...{Universe has been Modified!}... Last edited by BaCaRdi; 30th May 2008 at 05:37 AM. | |
| |
| | #13 |
|
Yes but if your in windows trying the alt method that is exactly what you would get Cheers Blue ![]() -BaC
__________________ Error[888] "while trying to load":[reality.sh] kernel: [Panic!]...{Universe has been Modified!}... Last edited by BaCaRdi; 30th May 2008 at 05:40 AM. | |
| |
| | #14 | |
| Quote:
__________________ ========================= Futz's Microcontrollers & Robotics ========================= | ||
| |
| | #15 |
|
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[888] "while trying to load":[reality.sh] kernel: [Panic!]...{Universe has been Modified!}... Last edited by BaCaRdi; 30th May 2008 at 06:18 AM. | |
| |
|
| Tags |
| boostc, degree, lcd, sprintf, symbol |
| Thread Tools | |
| Display Modes | |
| |
Similar | ||||
| Title | Starter | Forum | Replies | Latest |
| College Degree: A Complete Waste so far | DigiTan | Chit-Chat | 150 | 11th August 2008 07:14 PM |
| math.h and lib for BoostC? | futz | Micro Controllers | 3 | 31st March 2008 06:29 AM |
| Symbol ? | ATSRND | General Electronics Chat | 1 | 9th January 2008 04:05 AM |
| Final Year Electronics Degree Project | rgraj | Electronic Projects Design/Ideas/Reviews | 2 | 25th March 2006 05:19 PM |
| What does this symbol mean? | DJ_ReL@X! | General Electronics Chat | 6 | 24th October 2004 01:01 AM |