SmartCampus / Mbed OS OLED_NTC_graph

Dependencies:   SSD1308_128x64_I2C Grove_temperature

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers wave.cpp Source File

wave.cpp

00001 #include "wave.h"
00002 
00003 Temperature::Temperature(void)
00004 {
00005     u8_page = 7;
00006     u8_col = 127;
00007     u8_temperature = 0;
00008     u8_value = 0;
00009 }
00010 
00011 Temperature::~Temperature(void)
00012 {
00013     
00014 }
00015 
00016 void Temperature::calcPage(void)        //calculate the display page of this temperature
00017 {
00018     uint8_t tmp;
00019     tmp = u8_temperature / 8;
00020     u8_page = 7 - tmp;  //7 - tmp
00021 }
00022 
00023 void Temperature::calcValue(void)       //calculate the I2C value of this temperature
00024 {
00025     uint8_t index;
00026     
00027     index = 7 - ( u8_temperature % 8 );
00028     u8_value = (0x01) << index;
00029 }