EasyManuals Logo

Texas Instruments MSP430 User Manual

Texas Instruments MSP430
413 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #251 background imageLoading...
Page #251 background image
251
ch = (value / 1000);
OLED_print_char((x_pos + 6), y_pos , (0x30 + ch));
if(points > 1)
{
ch = ((value % 1000) / 100);
OLED_print_char((x_pos + 12), y_pos , (0x30 + ch));
if(points > 2)
{
ch = ((value % 100) / 10);
OLED_print_char((x_pos + 18), y_pos , (0x30 + ch));
if(points > 3)
{
ch = (value % 10);
OLED_print_char((x_pos + 24), y_pos , (0x30 + ch));
}
}
}
}
void OLED_print_float(unsigned char x_pos, unsigned char y_pos, float value,
unsigned char points)
{
signed long tmp = 0;
tmp = value;
OLED_print_int(x_pos, y_pos, tmp);
tmp = ((value - tmp) * 10000);
if(tmp < 0)
{
tmp = -tmp;
}
if((value >= 10000) && (value < 100000))
{
OLED_print_decimal((x_pos + 36), y_pos, tmp, points);
}
else if((value >= 1000) && (value < 10000))
{
OLED_print_decimal((x_pos + 30), y_pos, tmp, points);
}
else if((value >= 100) && (value < 1000))
{
OLED_print_decimal((x_pos + 24), y_pos, tmp, points);
}
else if((value >= 10) && (value < 100))
{
OLED_print_decimal((x_pos + 18), y_pos, tmp, points);
}
else if(value < 10)
{
OLED_print_decimal((x_pos + 12), y_pos, tmp, points);
if(value < 0)

Table of Contents

Other manuals for Texas Instruments MSP430

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments MSP430 and is the answer not in the manual?

Texas Instruments MSP430 Specifications

General IconGeneral
BrandTexas Instruments
ModelMSP430
CategoryMicrocontrollers
LanguageEnglish

Related product manuals