Jun 10, 2011 #1 F freeidea Member level 1 Joined May 19, 2011 Messages 36 Helped 3 Reputation 6 Reaction score 3 Trophy points 1,288 Activity points 1,920 i need to display 3 digit in lcd,i ask a example of calculation
Jun 11, 2011 #2 andre_luis Super Moderator Staff member Joined Nov 7, 2006 Messages 9,593 Helped 1,190 Reputation 2,399 Reaction score 1,207 Trophy points 1,403 Location Brazil Activity points 55,674 Considering assumption that you are programming in C language : Code: void WriteNum3dec( unsigned charnum ) { unsigned char dig; dig = num / 100 + '0'; if ( ( dig == 0 ) && ( ISWHITE ) ) SayChar( WHITE ); else SayChar( dig ); dig = (num % 100) / 10 + '0'; SayChar( dig ); dig = (num % 10) + '0'; SayChar( dig ); +++
Considering assumption that you are programming in C language : Code: void WriteNum3dec( unsigned charnum ) { unsigned char dig; dig = num / 100 + '0'; if ( ( dig == 0 ) && ( ISWHITE ) ) SayChar( WHITE ); else SayChar( dig ); dig = (num % 100) / 10 + '0'; SayChar( dig ); dig = (num % 10) + '0'; SayChar( dig ); +++
Jun 11, 2011 #3 F freeidea Member level 1 Joined May 19, 2011 Messages 36 Helped 3 Reputation 6 Reaction score 3 Trophy points 1,288 Activity points 1,920 in flowcode
Jun 11, 2011 #4 andre_luis Super Moderator Staff member Joined Nov 7, 2006 Messages 9,593 Helped 1,190 Reputation 2,399 Reaction score 1,207 Trophy points 1,403 Location Brazil Activity points 55,674 What is the reason ? C is allmost a descriptive language, and you can easilly perform that task, whatever the purpose. +++
What is the reason ? C is allmost a descriptive language, and you can easilly perform that task, whatever the purpose. +++
Jun 11, 2011 #5 F freeidea Member level 1 Joined May 19, 2011 Messages 36 Helped 3 Reputation 6 Reaction score 3 Trophy points 1,288 Activity points 1,920 thank andre