fix : fix comment and document
This commit is contained in:
@@ -2,13 +2,13 @@
|
||||
|
||||
#include "grove_alphanumeric_display.h"
|
||||
|
||||
Seeee_Digital_Tube tube1;
|
||||
Seeee_Digital_Tube tube2;
|
||||
Seeed_Digital_Tube tube1;
|
||||
Seeed_Digital_Tube tube2;
|
||||
|
||||
/**
|
||||
* NOTICE:Every tubes display has the same default i2c address.
|
||||
* if you want to combine two(or more)display in one project,you should change the i2c
|
||||
* i2c address,by soldering the pad of display backside.
|
||||
* if you want to combine two(or more)display in one project,you should change the
|
||||
* i2c address,by soldering the pad of device's backside.
|
||||
* please refer to our wiki to get more details.
|
||||
* */
|
||||
#define I2C_ADDR_AFTER_CHANGE_FOUR 0x75
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
#include "grove_alphanumeric_display.h"
|
||||
|
||||
Seeee_Digital_Tube tube;
|
||||
Seeed_Digital_Tube tube;
|
||||
|
||||
void setup()
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* display_custom_4.ino
|
||||
* display_custom.ino
|
||||
* Example for digital tube.
|
||||
*
|
||||
* Copyright (c) 2018 Seeed Technology Co., Ltd.
|
||||
@@ -31,12 +31,9 @@
|
||||
#include <Wire.h>
|
||||
|
||||
|
||||
/*********************************************************/
|
||||
/*****NOTICE : This example only for qual_alphanumeric****/
|
||||
/*********************************************************/
|
||||
#include "grove_alphanumeric_display.h"
|
||||
|
||||
Seeee_Digital_Tube tube;
|
||||
Seeed_Digital_Tube tube;
|
||||
|
||||
|
||||
void setup()
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include "grove_alphanumeric_display.h"
|
||||
|
||||
|
||||
Seeee_Digital_Tube tube;
|
||||
Seeed_Digital_Tube tube;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <Wire.h>
|
||||
#include "grove_alphanumeric_display.h"
|
||||
|
||||
Seeee_Digital_Tube tube;
|
||||
Seeed_Digital_Tube tube;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* number_increment_2.ino
|
||||
* number_increment.ino
|
||||
* Driver for digital tube.
|
||||
*
|
||||
* Copyright (c) 2018 Seeed Technology Co., Ltd.
|
||||
@@ -32,7 +32,7 @@
|
||||
#include "grove_alphanumeric_display.h"
|
||||
|
||||
|
||||
Seeee_Digital_Tube tube;
|
||||
Seeed_Digital_Tube tube;
|
||||
|
||||
char hex_str[10];
|
||||
|
||||
|
||||
@@ -130,14 +130,14 @@ uint16_t g_display_font2[]={
|
||||
};
|
||||
|
||||
|
||||
Seeee_Digital_Tube::Seeee_Digital_Tube()
|
||||
Seeed_Digital_Tube::Seeed_Digital_Tube()
|
||||
{
|
||||
|
||||
_ms = 100;
|
||||
}
|
||||
|
||||
|
||||
void Seeee_Digital_Tube::setTubeType(TubeType_t type,uint8_t addr)
|
||||
void Seeed_Digital_Tube::setTubeType(TubeType_t type,uint8_t addr)
|
||||
{
|
||||
_type = type;
|
||||
(_type == TYPE_2) ? (_tube_cnt = CNT_2) : (_tube_cnt = CNT_4);
|
||||
@@ -145,7 +145,7 @@ void Seeee_Digital_Tube::setTubeType(TubeType_t type,uint8_t addr)
|
||||
HT16K33::init(addr);
|
||||
}
|
||||
|
||||
bool Seeee_Digital_Tube::isLegalToDisplay(char byte)
|
||||
bool Seeed_Digital_Tube::isLegalToDisplay(char byte)
|
||||
{
|
||||
if( !((byte >= '.' && byte <= '9') || (byte >= 'A' && byte <= 'Z') || (byte >= 'a' && byte <= 'z') ) )
|
||||
return false;
|
||||
@@ -160,7 +160,7 @@ bool Seeee_Digital_Tube::isLegalToDisplay(char byte)
|
||||
* @param num the number to display.
|
||||
* @param interval :the interval of scroll number.
|
||||
* */
|
||||
void Seeee_Digital_Tube::displayNum(uint32_t num,uint32_t interval)
|
||||
void Seeed_Digital_Tube::displayNum(uint32_t num,uint32_t interval)
|
||||
{
|
||||
char num_str[15] = {0};
|
||||
sprintf(num_str,"%ld",(uint32_t)num);
|
||||
@@ -169,7 +169,7 @@ void Seeee_Digital_Tube::displayNum(uint32_t num,uint32_t interval)
|
||||
|
||||
|
||||
|
||||
void Seeee_Digital_Tube::shiftDisplay(char *origin_disp_buf,char new_item)
|
||||
void Seeed_Digital_Tube::shiftDisplay(char *origin_disp_buf,char new_item)
|
||||
{
|
||||
char temp[MAX_TUBE_COUNT] = {0};
|
||||
|
||||
@@ -193,7 +193,7 @@ void Seeee_Digital_Tube::shiftDisplay(char *origin_disp_buf,char new_item)
|
||||
* @param str the str to display.
|
||||
* @param interval :the interval of scroll string.
|
||||
* */
|
||||
void Seeee_Digital_Tube::displayString(char *str,uint32_t interval)
|
||||
void Seeed_Digital_Tube::displayString(char *str,uint32_t interval)
|
||||
{
|
||||
int len = 0;
|
||||
clearBuf();
|
||||
@@ -230,7 +230,7 @@ void Seeee_Digital_Tube::displayString(char *str,uint32_t interval)
|
||||
}
|
||||
|
||||
|
||||
void Seeee_Digital_Tube::clear()
|
||||
void Seeed_Digital_Tube::clear()
|
||||
{
|
||||
memset(_buffer, 0, sizeof(_buffer));
|
||||
writeBytes(_addr, 0x00, 16, _buffer);
|
||||
@@ -238,7 +238,7 @@ void Seeee_Digital_Tube::clear()
|
||||
}
|
||||
|
||||
|
||||
void Seeee_Digital_Tube::fulDisplay()
|
||||
void Seeed_Digital_Tube::fulDisplay()
|
||||
{
|
||||
uint8_t buf[16] = {0};
|
||||
memcpy(_buffer,buf,sizeof(buf));
|
||||
@@ -247,12 +247,12 @@ void Seeee_Digital_Tube::fulDisplay()
|
||||
delay(_ms);
|
||||
}
|
||||
|
||||
/** Because of the difference of the hardware design of two kinds of display(two & four tubes).
|
||||
/** There are some differences of the hardware design of two kinds of display(two & four tubes).
|
||||
* two digital tubes use _buffer[2,3,4,5] to control display.
|
||||
* four digital tubes use _buffer[2,3,4,5,6,7,8,9,10,11] to control display.
|
||||
*
|
||||
**/
|
||||
void Seeee_Digital_Tube::replace_bit12(TubeNum tube_num,bool bit1,bool bit2)
|
||||
void Seeed_Digital_Tube::replace_bit12(TubeNum tube_num,bool bit1,bool bit2)
|
||||
{
|
||||
switch(tube_num)
|
||||
{
|
||||
@@ -289,7 +289,7 @@ void Seeee_Digital_Tube::replace_bit12(TubeNum tube_num,bool bit1,bool bit2)
|
||||
}
|
||||
}
|
||||
|
||||
void Seeee_Digital_Tube::setPoint(bool first_dot,bool second_dot)
|
||||
void Seeed_Digital_Tube::setPoint(bool first_dot,bool second_dot)
|
||||
{
|
||||
if( TYPE_4 == _type )
|
||||
{
|
||||
@@ -317,7 +317,7 @@ void Seeee_Digital_Tube::setPoint(bool first_dot,bool second_dot)
|
||||
}
|
||||
|
||||
|
||||
void Seeee_Digital_Tube::setTubeBuf(TubeNum tube_num,char byte)
|
||||
void Seeed_Digital_Tube::setTubeBuf(TubeNum tube_num,char byte)
|
||||
{
|
||||
uint16_t value = disp_font_p[get_char_index(byte)];
|
||||
|
||||
@@ -363,7 +363,7 @@ void Seeee_Digital_Tube::setTubeBuf(TubeNum tube_num,char byte)
|
||||
* @param tube_num The number of tube ,total 4.
|
||||
* @param c ,The char to display
|
||||
* */
|
||||
void Seeee_Digital_Tube::setTubeSingleChar(TubeNum tube_num,char c)
|
||||
void Seeed_Digital_Tube::setTubeSingleChar(TubeNum tube_num,char c)
|
||||
{
|
||||
if(!( ((c >= 'A') && (c <= 'Z')) || ((c >= 'a') && (c <= 'z')) || (c=='.') ) )
|
||||
{
|
||||
@@ -389,7 +389,7 @@ void Seeee_Digital_Tube::setTubeSingleChar(TubeNum tube_num,char c)
|
||||
* @param tube_num The number of tube ,total 4.
|
||||
* @param num ,The number to display
|
||||
* */
|
||||
void Seeee_Digital_Tube::setTubeSingleNum(TubeNum tube_num,char num)
|
||||
void Seeed_Digital_Tube::setTubeSingleNum(TubeNum tube_num,char num)
|
||||
{
|
||||
if( !((num >= 0) && (num <= 9)) )
|
||||
return ;
|
||||
@@ -411,7 +411,7 @@ void Seeee_Digital_Tube::setTubeSingleNum(TubeNum tube_num,char num)
|
||||
}
|
||||
|
||||
|
||||
void Seeee_Digital_Tube::display_one_tube(TubeNum tube_num,uint16_t value)
|
||||
void Seeed_Digital_Tube::display_one_tube(TubeNum tube_num,uint16_t value)
|
||||
{
|
||||
_buffer[tube_num*2] = value;
|
||||
_buffer[tube_num*2+1] = value >> 8;
|
||||
@@ -421,12 +421,12 @@ void Seeee_Digital_Tube::display_one_tube(TubeNum tube_num,uint16_t value)
|
||||
}
|
||||
|
||||
|
||||
void Seeee_Digital_Tube::clearBuf()
|
||||
void Seeed_Digital_Tube::clearBuf()
|
||||
{
|
||||
memset(_buffer,0,sizeof(_buffer));
|
||||
}
|
||||
|
||||
int Seeee_Digital_Tube::get_char_index(char c)
|
||||
int Seeed_Digital_Tube::get_char_index(char c)
|
||||
{
|
||||
if((c >= '0') && (c <= '9'))
|
||||
{
|
||||
@@ -447,7 +447,7 @@ int Seeee_Digital_Tube::get_char_index(char c)
|
||||
}
|
||||
|
||||
|
||||
void Seeee_Digital_Tube::display()
|
||||
void Seeed_Digital_Tube::display()
|
||||
{
|
||||
writeBytes(_addr, 0x00, 16, _buffer);
|
||||
delay(_ms);
|
||||
|
||||
@@ -72,22 +72,22 @@ typedef enum{
|
||||
CNT_4 = 4,
|
||||
}TubeCnt_t;
|
||||
|
||||
class Seeee_Digital_Tube : public HT16K33 {
|
||||
class Seeed_Digital_Tube : public HT16K33 {
|
||||
|
||||
public:
|
||||
Seeee_Digital_Tube();
|
||||
Seeed_Digital_Tube();
|
||||
|
||||
void setTubeType(TubeType_t type,uint8_t addr = TYPE_2_DEFAULT_I2C_ADDR);
|
||||
|
||||
void clear();
|
||||
/**@brief Display number,If the param-num's len less than 4,The tubes display static number,otherwise,it displays scroll number.
|
||||
/**@brief Display number,If the param-num's len less than count of tubes(2 or 4),The tubes display static number,otherwise,it displays scroll number.
|
||||
* When it displays scroll number,the param interval is scrolling interval(ms) ..
|
||||
* @param num the number to display.
|
||||
* @param interval :the interval of scroll number.
|
||||
* */
|
||||
void displayNum(uint32_t num,uint32_t interval = 0);
|
||||
|
||||
/**@brief Display string,If the param-str's len less than 4,The tubes display static string,otherwise,it displays scroll string.
|
||||
/**@brief Display string,If the param-str's len less than count of tube(2 or 4),The tubes display static string,otherwise,it displays scroll string.
|
||||
* When it displays scroll string,the param interval is scrolling interval(ms) ..
|
||||
* @param str the str to display.
|
||||
* @param interval :the interval of scroll string.
|
||||
@@ -111,20 +111,20 @@ public:
|
||||
void display();
|
||||
|
||||
/**@brief Specify the display char of a digital tube.
|
||||
* @param tube_num The number of tube ,total 4.
|
||||
* @param tube_num The number of tube ,depend on the device you are using (max : 2 or 4).
|
||||
* @param num ,The number to display
|
||||
* */
|
||||
void setTubeSingleChar(TubeNum tube_num,char c);
|
||||
|
||||
/**@brief Specify the display number of a digital tube.
|
||||
* @param tube_num The number of tube ,total 4.
|
||||
* @param tube_num The number of tube ,depend on the device you are using ( max : 2 or 4).
|
||||
* @param num ,The number to display
|
||||
* */
|
||||
void setTubeSingleNum(TubeNum tube_num,char num);
|
||||
|
||||
/**@brief Set two points status.
|
||||
* @prarm upper_on if true,the upper point light on ,otherwise turn off;
|
||||
* @prarm lower_on if true,the upper point light on ,otherwise turn off;
|
||||
* @prarm upper_on if true,the first point light on ,otherwise turn off;
|
||||
* @prarm lower_on if true,the second point light on ,otherwise turn off;
|
||||
* */
|
||||
void setPoint(bool first_dot,bool second_dot);
|
||||
private:
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#######################################
|
||||
# Datatypes (KEYWORD1)
|
||||
#######################################
|
||||
Seeee_Digital_Tube KEYWORD1
|
||||
Seeed_Digital_Tube KEYWORD1
|
||||
|
||||
#######################################
|
||||
# Methods and Functions (KEYWORD2)
|
||||
|
||||
Reference in New Issue
Block a user