Can I use ItoA (integer to ascii) instruction with PIC16f873
Posted: Mon Jan 31, 2005 10:56 am
I am trying the split numbers captured from the tmr0 register in separate digits e.g 123 into 1,2,3 so that i can send it each digit to different 7segment display which have been multiplexed at the pic 16f873 output pins.
I am using C and the CCS compiler.
Can anybody help pls?
Regards,
rwyoung
Joined: 12 Nov 2003 Posts: 563 Location: Lawrence, KS USA
Posted: Mon Jan 31, 2005 11:02 am
123 / 100 = 1
123 % 100 = 23
23 / 10 = 2
23 % 10 = 3 _________________ Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month!
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
Posted: Mon Jan 31, 2005 11:47 am
Quote:
Can I use ItoA (integer to ascii) instruction with PIC16f873
Yes. You could also use sprintf and force the output to always use 3 digits.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum