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 #249 background imageLoading...
Page #249 background image
249
if((value > 99) && (value <= 999))
{
ch = (value / 100);
OLED_print_char((x_pos + 6), y_pos , (0x30 + ch));
ch = ((value % 100) / 10);
OLED_print_char((x_pos + 12), y_pos , (0x30 + ch));
ch = (value % 10);
OLED_print_char((x_pos + 18), y_pos , (0x30 + ch));
}
else if((value > 9) && (value <= 99))
{
ch = ((value % 100) / 10);
OLED_print_char((x_pos + 6), y_pos , (0x30 + ch));
ch = (value % 10);
OLED_print_char((x_pos + 12), y_pos , (0x30 + ch));
OLED_print_char((x_pos + 18), y_pos , 0x20);
}
else if((value >= 0) && (value <= 9))
{
ch = (value % 10);
OLED_print_char((x_pos + 6), y_pos , (0x30 + ch));
OLED_print_char((x_pos + 12), y_pos , 0x20);
OLED_print_char((x_pos + 18), y_pos , 0x20);
}
}
void OLED_print_int(unsigned char x_pos, unsigned char y_pos, signed long value)
{
unsigned char ch = 0;
if(value < 0)
{
OLED_print_char(x_pos, y_pos, '-');
value = -value;
}
else
{
OLED_print_char(x_pos, y_pos,' ');
}
if(value > 9999)
{
ch = (value / 10000);
OLED_print_char((x_pos + 6), y_pos , (0x30 + ch));
ch = ((value % 10000)/ 1000);
OLED_print_char((x_pos + 12), y_pos , (0x30 + ch));
ch = ((value % 1000) / 100);
OLED_print_char((x_pos + 18), y_pos , (0x30 + ch));
ch = ((value % 100) / 10);
OLED_print_char((x_pos + 24), y_pos , (0x30 + ch));
ch = (value % 10);
OLED_print_char((x_pos + 30), y_pos , (0x30 + ch));
}

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