国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

【單片機】MSP430單片機,1.3寸 IIC OLED ,顯示驅(qū)動

這篇具有很好參考價值的文章主要介紹了【單片機】MSP430單片機,1.3寸 IIC OLED ,顯示驅(qū)動。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

msp430g2553控制oled,單片機,單片機,MSP430,OLED,1.3寸,IIC文章來源地址http://www.zghlxwxcb.cn/news/detail-606681.html

main.c

#include <msp430.h>
#include "OLED.h"

int main( void )
{
	WDTCTL = WDTPW + WDTHOLD;       /* Stop WDT */
	if ( CALBC1_8MHZ == 0xFF )      /* If calibration constant erased */
	{
		while ( 1 )
			;               /* do not load, trap CPU!! */
	}
	DCOCTL	= 0;                    /* Select lowest DCOx and MODx settings */
	BCSCTL1 = CALBC1_8MHZ;          /* Set range */
	DCOCTL	= CALDCO_8MHZ;          /* Set DCO step + modulation * / */

	OLED_Init();                    /* OLED初始化 */
	OLED_ShowString(1, 1, "ABCDEFGABCDEFG" );
	OLED_ShowString(2, 1, "ABCDEFGABCDEFG" );
	OLED_ShowString(3, 1, "ABCDEFGABCDEFG" );
	OLED_ShowString(4, 1, "ABCDEFGABCDEFG" );
	while ( 1 )
	{

	}
}

oled.h

#include "msp430g2553.h"

#include "oledfont.h"


void OLED_Init(void);
void OLED_Clear(void);
void OLED_ShowChar(unsigned char Line, unsigned char Column, char Char);
void OLED_ShowString(unsigned char Line, unsigned char Column, char *String);
void OLED_ShowNum(unsigned char Line, unsigned char Column, unsigned int Number, unsigned char Length);
void OLED_ShowSignedNum(unsigned char Line, unsigned char Column, unsigned int Number, unsigned char Length);
void OLED_ShowHexNum(unsigned char Line, unsigned char Column, unsigned int Number, unsigned char Length);
void OLED_ShowBinNum(unsigned char Line, unsigned char Column, unsigned int Number, unsigned char Length);

// ------------------------------------------------------------
// IO口模擬I2C通信
// SCL接P2^0
// SDA接P2^1

#define SCL_1 P2OUT |= BIT0
#define SCL_0 P2OUT &= ~BIT0
#define SDA_1 P2OUT |= BIT1
#define SDA_0 P2OUT &= ~BIT1

#define CPU_F ( (double) 8000000)
#define delay_us( x )   __delay_cycles( (long) (CPU_F * (double) x / 1000000.0) )
#define delay_ms( x )   __delay_cycles( (long) (CPU_F * (double) x / 1000.0) )


void oled_port_init(void)
{
    P2DIR |= BIT0 + BIT1;
}

/***********OLED驅(qū)動程序用的延時程序**************/
void delay(unsigned int z)
{
    unsigned int x;
    for (x = z; x > 0; x--)
        delay_ms(1);
}

/**
  * @brief  I2C開始
  * @param  無
  * @retval 無
  */
void OLED_I2C_Start(void)
{
    SDA_1;
    SCL_1;
    SDA_0;
    SCL_0;
}

/**
  * @brief  I2C停止
  * @param  無
  * @retval 無
  */
void OLED_I2C_Stop(void)
{
    SDA_0;
    SCL_1;
    SDA_1;
}

/**
  * @brief  I2C發(fā)送一個字節(jié)
  * @param  IIC_Byte 要發(fā)送的一個字節(jié)
  * @retval 無
  */
void OLED_I2C_SendByte(unsigned char IIC_Byte)
{
    unsigned char i;
    for (i = 0; i < 8; i++)
    {
        if (IIC_Byte & 0x80)
            SDA_1;
        else
            SDA_0;

        SCL_1;
        SCL_0;
        IIC_Byte <<= 1;
    }
    SCL_1;
    SCL_0;
}



/**
  * @brief  OLED寫命令
  * @param  Command 要寫入的命令
  * @retval 無
  */
void OLED_WriteCommand(unsigned char Command)
{
    OLED_I2C_Start();
    OLED_I2C_SendByte(0x78);        //從機地址
    OLED_I2C_SendByte(0x00);        //寫命令
    OLED_I2C_SendByte(Command);
    OLED_I2C_Stop();
}

/**
  * @brief  OLED寫數(shù)據(jù)
  * @param  Data 要寫入的數(shù)據(jù)
  * @retval 無
  */
void OLED_WriteData(unsigned char Data)
{
    OLED_I2C_Start();
    OLED_I2C_SendByte(0x78);        //從機地址
    OLED_I2C_SendByte(0x40);        //寫數(shù)據(jù)
    OLED_I2C_SendByte(Data);
    OLED_I2C_Stop();
}

/**
  * @brief  OLED設(shè)置光標(biāo)位置
  * @param  Y 以左上角為原點,向下方向的坐標(biāo),范圍:0~7
  * @param  X 以左上角為原點,向右方向的坐標(biāo),范圍:0~127
  * @retval 無
  */
void OLED_SetCursor(unsigned char Y, unsigned char X)
{
    OLED_WriteCommand(0xB0 | Y);                    //設(shè)置Y位置
    OLED_WriteCommand(0x10 | ((X & 0xF0) >> 4));    //設(shè)置X位置低4位
    OLED_WriteCommand(0x02 | (X & 0x0F));           //設(shè)置X位置高4位
}

/**
  * @brief  OLED清屏
  * @param  無
  * @retval 無
  */
void OLED_Clear(void)
{
    unsigned char i, j;
    for (j = 0; j < 8; j++)
    {
        OLED_SetCursor(j, 0);
        for(i = 0; i < 128; i++)
        {
            OLED_WriteData(0x00);
        }
    }
}

/**
  * @brief  OLED顯示一個字符
  * @param  Line 行位置,范圍:1~4
  * @param  Column 列位置,范圍:1~16
  * @param  Char 要顯示的一個字符,范圍:ASCII可見字符
  * @retval 無
  */
void OLED_ShowChar(unsigned char Line, unsigned char Column, char Char)
{
    unsigned char i;
    OLED_SetCursor((Line - 1) * 2, (Column - 1) * 8);       //設(shè)置光標(biāo)位置在上半部分
    for (i = 0; i < 8; i++)
    {
        OLED_WriteData(OLED_F8x16[Char - ' '][i]);          //顯示上半部分內(nèi)容
    }
    OLED_SetCursor((Line - 1) * 2 + 1, (Column - 1) * 8);   //設(shè)置光標(biāo)位置在下半部分
    for (i = 0; i < 8; i++)
    {
        OLED_WriteData(OLED_F8x16[Char - ' '][i + 8]);      //顯示下半部分內(nèi)容
    }
}

/**
  * @brief  OLED顯示字符串
  * @param  Line 起始行位置,范圍:1~4
  * @param  Column 起始列位置,范圍:1~16
  * @param  String 要顯示的字符串,范圍:ASCII可見字符
  * @retval 無
  */
void OLED_ShowString(unsigned char Line, unsigned char Column, char *String)
{
    unsigned char i;
    for (i = 0; String[i] != '\0'; i++)
    {
        OLED_ShowChar(Line, Column + i, String[i]);
    }
}

/**
  * @brief  OLED次方函數(shù)
  * @retval 返回值等于X的Y次方
  */
unsigned int OLED_Pow(unsigned int X, unsigned int Y)
{
    unsigned int Result = 1;
    while (Y--)
    {
        Result *= X;
    }
    return Result;
}

/**
  * @brief  OLED顯示數(shù)字(十進制,正數(shù))
  * @param  Line 起始行位置,范圍:1~4
  * @param  Column 起始列位置,范圍:1~16
  * @param  Number 要顯示的數(shù)字,范圍:0~4294967295
  * @param  Length 要顯示數(shù)字的長度,范圍:1~10
  * @retval 無
  */
void OLED_ShowNum(unsigned char Line, unsigned char Column, unsigned int Number, unsigned char Length)
{
    unsigned char i;
    for (i = 0; i < Length; i++)
    {
        OLED_ShowChar(Line, Column + i, Number / OLED_Pow(10, Length - i - 1) % 10 + '0');
    }
}

/**
  * @brief  OLED顯示數(shù)字(十進制,帶符號數(shù))
  * @param  Line 起始行位置,范圍:1~4
  * @param  Column 起始列位置,范圍:1~16
  * @param  Number 要顯示的數(shù)字,范圍:-2147483648~2147483647
  * @param  Length 要顯示數(shù)字的長度,范圍:1~10
  * @retval 無
  */
void OLED_ShowSignedNum(unsigned char Line, unsigned char Column, unsigned int Number, unsigned char Length)
{
    unsigned char i;
    unsigned int Number1;
    if (Number >= 0)
    {
        OLED_ShowChar(Line, Column, '+');
        Number1 = Number;
    }
    else
    {
        OLED_ShowChar(Line, Column, '-');
        Number1 = -Number;
    }
    for (i = 0; i < Length; i++)
    {
        OLED_ShowChar(Line, Column + i + 1, Number1 / OLED_Pow(10, Length - i - 1) % 10 + '0');
    }
}

/**
  * @brief  OLED顯示數(shù)字(十六進制,正數(shù))
  * @param  Line 起始行位置,范圍:1~4
  * @param  Column 起始列位置,范圍:1~16
  * @param  Number 要顯示的數(shù)字,范圍:0~0xFFFFFFFF
  * @param  Length 要顯示數(shù)字的長度,范圍:1~8
  * @retval 無
  */
void OLED_ShowHexNum(unsigned char Line, unsigned char Column, unsigned int Number, unsigned char Length)
{
    unsigned char i, SingleNumber;
    for (i = 0; i < Length; i++)
    {
        SingleNumber = Number / OLED_Pow(16, Length - i - 1) % 16;
        if (SingleNumber < 10)
        {
            OLED_ShowChar(Line, Column + i, SingleNumber + '0');
        }
        else
        {
            OLED_ShowChar(Line, Column + i, SingleNumber - 10 + 'A');
        }
    }
}

/**
  * @brief  OLED顯示數(shù)字(二進制,正數(shù))
  * @param  Line 起始行位置,范圍:1~4
  * @param  Column 起始列位置,范圍:1~16
  * @param  Number 要顯示的數(shù)字,范圍:0~1111 1111 1111 1111
  * @param  Length 要顯示數(shù)字的長度,范圍:1~16
  * @retval 無
  */
void OLED_ShowBinNum(unsigned char Line, unsigned char Column, unsigned int Number, unsigned char Length)
{
    unsigned char i;
    for (i = 0; i < Length; i++)
    {
        OLED_ShowChar(Line, Column + i, Number / OLED_Pow(2, Length - i - 1) % 2 + '0');
    }
}

/**
  * @brief  OLED初始化
  * @param  無
  * @retval 無
  */
void OLED_Init(void)
{

    delay_ms(500);

    oled_port_init();           //端口初始化

    OLED_WriteCommand(0xAE);    //關(guān)閉顯示

    OLED_WriteCommand(0xD5);    //設(shè)置顯示時鐘分頻比/振蕩器頻率
    OLED_WriteCommand(0x80);

    OLED_WriteCommand(0xA8);    //設(shè)置多路復(fù)用率
    OLED_WriteCommand(0x3F);

    OLED_WriteCommand(0xD3);    //設(shè)置顯示偏移
    OLED_WriteCommand(0x00);

    OLED_WriteCommand(0x40);    //設(shè)置顯示開始行

    OLED_WriteCommand(0xA1);    //設(shè)置左右方向,0xA1正常 0xA0左右反置

    OLED_WriteCommand(0xC8);    //設(shè)置上下方向,0xC8正常 0xC0上下反置

    OLED_WriteCommand(0xDA);    //設(shè)置COM引腳硬件配置
    OLED_WriteCommand(0x12);

    OLED_WriteCommand(0x81);    //設(shè)置對比度控制
    OLED_WriteCommand(0xCF);

    OLED_WriteCommand(0xD9);    //設(shè)置預(yù)充電周期
    OLED_WriteCommand(0xF1);

    OLED_WriteCommand(0xDB);    //設(shè)置VCOMH取消選擇級別
    OLED_WriteCommand(0x30);

    OLED_WriteCommand(0xA4);    //設(shè)置整個顯示打開/關(guān)閉

    OLED_WriteCommand(0xA6);    //設(shè)置正常/倒轉(zhuǎn)顯示

    OLED_WriteCommand(0x8D);    //設(shè)置充電泵
    OLED_WriteCommand(0x14);

    OLED_WriteCommand(0xAF);    //開啟顯示

    OLED_Clear();               //OLED清屏
}

oledfont.h

#ifndef __OLEDFONT_H
#define __OLEDFONT_H

/*OLED字模庫,寬8像素,高16像素*/
const unsigned char  OLED_F8x16[][16]=
{
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//  0

    0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x33,0x30,0x00,0x00,0x00,//! 1

    0x00,0x10,0x0C,0x06,0x10,0x0C,0x06,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//" 2

    0x40,0xC0,0x78,0x40,0xC0,0x78,0x40,0x00,
    0x04,0x3F,0x04,0x04,0x3F,0x04,0x04,0x00,//# 3

    0x00,0x70,0x88,0xFC,0x08,0x30,0x00,0x00,
    0x00,0x18,0x20,0xFF,0x21,0x1E,0x00,0x00,//$ 4

    0xF0,0x08,0xF0,0x00,0xE0,0x18,0x00,0x00,
    0x00,0x21,0x1C,0x03,0x1E,0x21,0x1E,0x00,//% 5

    0x00,0xF0,0x08,0x88,0x70,0x00,0x00,0x00,
    0x1E,0x21,0x23,0x24,0x19,0x27,0x21,0x10,//& 6

    0x10,0x16,0x0E,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//' 7

    0x00,0x00,0x00,0xE0,0x18,0x04,0x02,0x00,
    0x00,0x00,0x00,0x07,0x18,0x20,0x40,0x00,//( 8

    0x00,0x02,0x04,0x18,0xE0,0x00,0x00,0x00,
    0x00,0x40,0x20,0x18,0x07,0x00,0x00,0x00,//) 9

    0x40,0x40,0x80,0xF0,0x80,0x40,0x40,0x00,
    0x02,0x02,0x01,0x0F,0x01,0x02,0x02,0x00,//* 10

    0x00,0x00,0x00,0xF0,0x00,0x00,0x00,0x00,
    0x01,0x01,0x01,0x1F,0x01,0x01,0x01,0x00,//+ 11

    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x80,0xB0,0x70,0x00,0x00,0x00,0x00,0x00,//, 12

    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,//- 13

    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x30,0x30,0x00,0x00,0x00,0x00,0x00,//. 14

    0x00,0x00,0x00,0x00,0x80,0x60,0x18,0x04,
    0x00,0x60,0x18,0x06,0x01,0x00,0x00,0x00,/// 15

    0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,
    0x00,0x0F,0x10,0x20,0x20,0x10,0x0F,0x00,//0 16

    0x00,0x10,0x10,0xF8,0x00,0x00,0x00,0x00,
    0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//1 17

    0x00,0x70,0x08,0x08,0x08,0x88,0x70,0x00,
    0x00,0x30,0x28,0x24,0x22,0x21,0x30,0x00,//2 18

    0x00,0x30,0x08,0x88,0x88,0x48,0x30,0x00,
    0x00,0x18,0x20,0x20,0x20,0x11,0x0E,0x00,//3 19

    0x00,0x00,0xC0,0x20,0x10,0xF8,0x00,0x00,
    0x00,0x07,0x04,0x24,0x24,0x3F,0x24,0x00,//4 20

    0x00,0xF8,0x08,0x88,0x88,0x08,0x08,0x00,
    0x00,0x19,0x21,0x20,0x20,0x11,0x0E,0x00,//5 21

    0x00,0xE0,0x10,0x88,0x88,0x18,0x00,0x00,
    0x00,0x0F,0x11,0x20,0x20,0x11,0x0E,0x00,//6 22

    0x00,0x38,0x08,0x08,0xC8,0x38,0x08,0x00,
    0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x00,//7 23

    0x00,0x70,0x88,0x08,0x08,0x88,0x70,0x00,
    0x00,0x1C,0x22,0x21,0x21,0x22,0x1C,0x00,//8 24

    0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,
    0x00,0x00,0x31,0x22,0x22,0x11,0x0F,0x00,//9 25

    0x00,0x00,0x00,0xC0,0xC0,0x00,0x00,0x00,
    0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,//: 26

    0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,
    0x00,0x00,0x80,0x60,0x00,0x00,0x00,0x00,//; 27

    0x00,0x00,0x80,0x40,0x20,0x10,0x08,0x00,
    0x00,0x01,0x02,0x04,0x08,0x10,0x20,0x00,//< 28

    0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,
    0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x00,//= 29

    0x00,0x08,0x10,0x20,0x40,0x80,0x00,0x00,
    0x00,0x20,0x10,0x08,0x04,0x02,0x01,0x00,//> 30

    0x00,0x70,0x48,0x08,0x08,0x08,0xF0,0x00,
    0x00,0x00,0x00,0x30,0x36,0x01,0x00,0x00,//? 31

    0xC0,0x30,0xC8,0x28,0xE8,0x10,0xE0,0x00,
    0x07,0x18,0x27,0x24,0x23,0x14,0x0B,0x00,//@ 32

    0x00,0x00,0xC0,0x38,0xE0,0x00,0x00,0x00,
    0x20,0x3C,0x23,0x02,0x02,0x27,0x38,0x20,//A 33

    0x08,0xF8,0x88,0x88,0x88,0x70,0x00,0x00,
    0x20,0x3F,0x20,0x20,0x20,0x11,0x0E,0x00,//B 34

    0xC0,0x30,0x08,0x08,0x08,0x08,0x38,0x00,
    0x07,0x18,0x20,0x20,0x20,0x10,0x08,0x00,//C 35

    0x08,0xF8,0x08,0x08,0x08,0x10,0xE0,0x00,
    0x20,0x3F,0x20,0x20,0x20,0x10,0x0F,0x00,//D 36

    0x08,0xF8,0x88,0x88,0xE8,0x08,0x10,0x00,
    0x20,0x3F,0x20,0x20,0x23,0x20,0x18,0x00,//E 37

    0x08,0xF8,0x88,0x88,0xE8,0x08,0x10,0x00,
    0x20,0x3F,0x20,0x00,0x03,0x00,0x00,0x00,//F 38

    0xC0,0x30,0x08,0x08,0x08,0x38,0x00,0x00,
    0x07,0x18,0x20,0x20,0x22,0x1E,0x02,0x00,//G 39

    0x08,0xF8,0x08,0x00,0x00,0x08,0xF8,0x08,
    0x20,0x3F,0x21,0x01,0x01,0x21,0x3F,0x20,//H 40

    0x00,0x08,0x08,0xF8,0x08,0x08,0x00,0x00,
    0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//I 41

    0x00,0x00,0x08,0x08,0xF8,0x08,0x08,0x00,
    0xC0,0x80,0x80,0x80,0x7F,0x00,0x00,0x00,//J 42

    0x08,0xF8,0x88,0xC0,0x28,0x18,0x08,0x00,
    0x20,0x3F,0x20,0x01,0x26,0x38,0x20,0x00,//K 43

    0x08,0xF8,0x08,0x00,0x00,0x00,0x00,0x00,
    0x20,0x3F,0x20,0x20,0x20,0x20,0x30,0x00,//L 44

    0x08,0xF8,0xF8,0x00,0xF8,0xF8,0x08,0x00,
    0x20,0x3F,0x00,0x3F,0x00,0x3F,0x20,0x00,//M 45

    0x08,0xF8,0x30,0xC0,0x00,0x08,0xF8,0x08,
    0x20,0x3F,0x20,0x00,0x07,0x18,0x3F,0x00,//N 46

    0xE0,0x10,0x08,0x08,0x08,0x10,0xE0,0x00,
    0x0F,0x10,0x20,0x20,0x20,0x10,0x0F,0x00,//O 47

    0x08,0xF8,0x08,0x08,0x08,0x08,0xF0,0x00,
    0x20,0x3F,0x21,0x01,0x01,0x01,0x00,0x00,//P 48

    0xE0,0x10,0x08,0x08,0x08,0x10,0xE0,0x00,
    0x0F,0x18,0x24,0x24,0x38,0x50,0x4F,0x00,//Q 49

    0x08,0xF8,0x88,0x88,0x88,0x88,0x70,0x00,
    0x20,0x3F,0x20,0x00,0x03,0x0C,0x30,0x20,//R 50

    0x00,0x70,0x88,0x08,0x08,0x08,0x38,0x00,
    0x00,0x38,0x20,0x21,0x21,0x22,0x1C,0x00,//S 51

    0x18,0x08,0x08,0xF8,0x08,0x08,0x18,0x00,
    0x00,0x00,0x20,0x3F,0x20,0x00,0x00,0x00,//T 52

    0x08,0xF8,0x08,0x00,0x00,0x08,0xF8,0x08,
    0x00,0x1F,0x20,0x20,0x20,0x20,0x1F,0x00,//U 53

    0x08,0x78,0x88,0x00,0x00,0xC8,0x38,0x08,
    0x00,0x00,0x07,0x38,0x0E,0x01,0x00,0x00,//V 54

    0xF8,0x08,0x00,0xF8,0x00,0x08,0xF8,0x00,
    0x03,0x3C,0x07,0x00,0x07,0x3C,0x03,0x00,//W 55

    0x08,0x18,0x68,0x80,0x80,0x68,0x18,0x08,
    0x20,0x30,0x2C,0x03,0x03,0x2C,0x30,0x20,//X 56

    0x08,0x38,0xC8,0x00,0xC8,0x38,0x08,0x00,
    0x00,0x00,0x20,0x3F,0x20,0x00,0x00,0x00,//Y 57

    0x10,0x08,0x08,0x08,0xC8,0x38,0x08,0x00,
    0x20,0x38,0x26,0x21,0x20,0x20,0x18,0x00,//Z 58

    0x00,0x00,0x00,0xFE,0x02,0x02,0x02,0x00,
    0x00,0x00,0x00,0x7F,0x40,0x40,0x40,0x00,//[ 59

    0x00,0x0C,0x30,0xC0,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x01,0x06,0x38,0xC0,0x00,//\ 60

    0x00,0x02,0x02,0x02,0xFE,0x00,0x00,0x00,
    0x00,0x40,0x40,0x40,0x7F,0x00,0x00,0x00,//] 61

    0x00,0x00,0x04,0x02,0x02,0x02,0x04,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//^ 62

    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,//_ 63

    0x00,0x02,0x02,0x04,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//` 64

    0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,
    0x00,0x19,0x24,0x22,0x22,0x22,0x3F,0x20,//a 65

    0x08,0xF8,0x00,0x80,0x80,0x00,0x00,0x00,
    0x00,0x3F,0x11,0x20,0x20,0x11,0x0E,0x00,//b 66

    0x00,0x00,0x00,0x80,0x80,0x80,0x00,0x00,
    0x00,0x0E,0x11,0x20,0x20,0x20,0x11,0x00,//c 67

    0x00,0x00,0x00,0x80,0x80,0x88,0xF8,0x00,
    0x00,0x0E,0x11,0x20,0x20,0x10,0x3F,0x20,//d 68

    0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,
    0x00,0x1F,0x22,0x22,0x22,0x22,0x13,0x00,//e 69

    0x00,0x80,0x80,0xF0,0x88,0x88,0x88,0x18,
    0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//f 70

    0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x00,
    0x00,0x6B,0x94,0x94,0x94,0x93,0x60,0x00,//g 71

    0x08,0xF8,0x00,0x80,0x80,0x80,0x00,0x00,
    0x20,0x3F,0x21,0x00,0x00,0x20,0x3F,0x20,//h 72

    0x00,0x80,0x98,0x98,0x00,0x00,0x00,0x00,
    0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//i 73

    0x00,0x00,0x00,0x80,0x98,0x98,0x00,0x00,
    0x00,0xC0,0x80,0x80,0x80,0x7F,0x00,0x00,//j 74

    0x08,0xF8,0x00,0x00,0x80,0x80,0x80,0x00,
    0x20,0x3F,0x24,0x02,0x2D,0x30,0x20,0x00,//k 75

    0x00,0x08,0x08,0xF8,0x00,0x00,0x00,0x00,
    0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//l 76

    0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,
    0x20,0x3F,0x20,0x00,0x3F,0x20,0x00,0x3F,//m 77

    0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x00,
    0x20,0x3F,0x21,0x00,0x00,0x20,0x3F,0x20,//n 78

    0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,
    0x00,0x1F,0x20,0x20,0x20,0x20,0x1F,0x00,//o 79

    0x80,0x80,0x00,0x80,0x80,0x00,0x00,0x00,
    0x80,0xFF,0xA1,0x20,0x20,0x11,0x0E,0x00,//p 80

    0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x00,
    0x00,0x0E,0x11,0x20,0x20,0xA0,0xFF,0x80,//q 81

    0x80,0x80,0x80,0x00,0x80,0x80,0x80,0x00,
    0x20,0x20,0x3F,0x21,0x20,0x00,0x01,0x00,//r 82

    0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x00,
    0x00,0x33,0x24,0x24,0x24,0x24,0x19,0x00,//s 83

    0x00,0x80,0x80,0xE0,0x80,0x80,0x00,0x00,
    0x00,0x00,0x00,0x1F,0x20,0x20,0x00,0x00,//t 84

    0x80,0x80,0x00,0x00,0x00,0x80,0x80,0x00,
    0x00,0x1F,0x20,0x20,0x20,0x10,0x3F,0x20,//u 85

    0x80,0x80,0x80,0x00,0x00,0x80,0x80,0x80,
    0x00,0x01,0x0E,0x30,0x08,0x06,0x01,0x00,//v 86

    0x80,0x80,0x00,0x80,0x00,0x80,0x80,0x80,
    0x0F,0x30,0x0C,0x03,0x0C,0x30,0x0F,0x00,//w 87

    0x00,0x80,0x80,0x00,0x80,0x80,0x80,0x00,
    0x00,0x20,0x31,0x2E,0x0E,0x31,0x20,0x00,//x 88

    0x80,0x80,0x80,0x00,0x00,0x80,0x80,0x80,
    0x80,0x81,0x8E,0x70,0x18,0x06,0x01,0x00,//y 89

    0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x00,
    0x00,0x21,0x30,0x2C,0x22,0x21,0x30,0x00,//z 90

    0x00,0x00,0x00,0x00,0x80,0x7C,0x02,0x02,
    0x00,0x00,0x00,0x00,0x00,0x3F,0x40,0x40,//{ 91

    0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,//| 92

    0x00,0x02,0x02,0x7C,0x80,0x00,0x00,0x00,
    0x00,0x40,0x40,0x3F,0x00,0x00,0x00,0x00,//} 93

    0x00,0x06,0x01,0x01,0x02,0x02,0x04,0x04,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//~ 94
};


#endif



到了這里,關(guān)于【單片機】MSP430單片機,1.3寸 IIC OLED ,顯示驅(qū)動的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實不符,請點擊違法舉報進行投訴反饋,一經(jīng)查實,立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費用

相關(guān)文章

  • MSP430學(xué)習(xí)筆記(四)丨I2C通信(MSP430F5529驅(qū)動OLED顯示屏)

    ???筆者學(xué)習(xí)采用單片機型號為MSP430F5529,使用MSP-EXP430F5529LP開發(fā)板。 ???筆者擁有一定的STM32基礎(chǔ),在學(xué)習(xí)MSP430的過程中,最開始苦于沒有合適的OLED顯示驅(qū)動代碼,所以花了很多時間鉆研。綜合網(wǎng)上的各種代碼,筆者認(rèn)為江協(xié)科技的STM32課程中提供的OLED代碼使用方便,

    2024年02月16日
    瀏覽(25)
  • MSP430F5529單片機入門學(xué)習(xí)筆記1

    MSP430F5529單片機入門學(xué)習(xí)筆記1

    本筆記整理自B站教程 MSP430F5529單片機學(xué)習(xí)視頻匯總 右邊部分寫錯了,看的時候注意 注意#include“driverlib.h”頭文件時要注意: 添加MSP430F5xx_6xx文件夾到當(dāng)前工程下 MSP430F5xx_6xx文件夾是在導(dǎo)入的msp430ware_3_80_13_03包中找 把上述MSP430F5xx_6xx文件夾的路徑包含進來 有三個系統(tǒng)時鐘可

    2024年02月06日
    瀏覽(24)
  • 51單片機(IIC協(xié)議OLED屏)

    51單片機(IIC協(xié)議OLED屏)

    1.1、概述:IIC全稱Inter-Integrated Circuit (集成電路總線) 是由PHILIPS公司在80年代開發(fā)的兩線式串行總線,用于連接微控制器及其外圍設(shè)備。IIC屬于半雙 工同步通信方式 1.2、特點:簡單性和有效性。 由于接口直接在組件之上,因此IIC總線占用的空間非常小,減少了電路板的空間和

    2024年01月22日
    瀏覽(23)
  • K_A12_007 基于STM32等單片機驅(qū)動AS608光學(xué)指紋識別模塊 OLED0.96顯示

    K_A12_007 基于STM32等單片機驅(qū)動AS608光學(xué)指紋識別模塊 OLED0.96顯示

    注意:此處程序用的波特率都是9600 使用前請用上位機把模塊波特率調(diào)到9600 上位機使用與下載 直戳跳轉(zhuǎn) 單片機型號 測試條件 模塊名稱 代碼功能 STC89C52RC 晶振11.0592M AS608光學(xué)指紋模塊 STC89C52RC驅(qū)動AS608光學(xué)指紋模塊 串口與OLED0.96雙顯示 STM32F103C8T6 晶振8M/系統(tǒng)時鐘72M AS608光學(xué)指

    2024年02月06日
    瀏覽(32)
  • K_A16_001 基于STM32等單片機驅(qū)動HX711稱重模塊 串口與OLED0.96雙顯示

    K_A16_001 基于STM32等單片機驅(qū)動HX711稱重模塊 串口與OLED0.96雙顯示

    單片機型號 測試條件 模塊名稱 代碼功能 STC89C52RC 晶振11.0592M HX711稱重模塊 STC89C52RC驅(qū)動HX711稱重模塊 串口與OLED0.96雙顯示 STM32F103C8T6 晶振8M/系統(tǒng)時鐘72M HX711稱重模塊 STM32F103C8T6驅(qū)動HX711稱重模塊參數(shù) 串口與OLED0.96雙顯示 其他資料目錄 直戳跳轉(zhuǎn) HX711參數(shù) 1.兩路可選擇差分輸入

    2023年04月27日
    瀏覽(28)
  • K_A12_033 基于STM32等單片機驅(qū)動TCS34725顏色傳感 串口與OLED0.96雙顯示

    K_A12_033 基于STM32等單片機驅(qū)動TCS34725顏色傳感 串口與OLED0.96雙顯示

    單片機型號 測試條件 模塊名稱 代碼功能 STC89C52RC 晶振11.0592M TCS34725顏色傳感 模塊 STC89C52RC驅(qū)動TCS34725顏色傳感模塊串口與OLED0.96雙顯示 STM32F103C8T6 晶振8M/系統(tǒng)時鐘72M TCS34725顏色傳感模塊 STM32F103C8T6驅(qū)動TCS34725顏色傳感模塊串口與OLED0.96雙顯示 其他資料目錄 直戳跳轉(zhuǎn) 工作電壓:

    2024年02月06日
    瀏覽(30)
  • K_A37_005 基于STM32等單片機驅(qū)動ADS1115 ADC模塊 串口與OLED0.96雙顯示

    K_A37_005 基于STM32等單片機驅(qū)動ADS1115 ADC模塊 串口與OLED0.96雙顯示

    其他資料目錄 直戳跳轉(zhuǎn) 單片機型號 測試條件 模塊名稱 代碼功能 STC89C52RC 晶振11.0592M ADS1115 ADC模塊 STC89C52RC驅(qū)動ADS1115 ADC模塊 串口與OLED0.96雙顯示 STM32F103C8T6 晶振8M/系統(tǒng)時鐘72M ADS1115 ADC模塊 STM32F103C8T6驅(qū)動ADS1115 ADC模塊 串口與OLED0.96雙顯示 ADS1115 ADC模塊 引腳說明 VIN 正極 5V供電

    2024年02月16日
    瀏覽(31)
  • K_A18_008 基于STM32等單片機驅(qū)動SGP30氣體傳感器串口與OLED0.96雙顯示

    K_A18_008 基于STM32等單片機驅(qū)動SGP30氣體傳感器串口與OLED0.96雙顯示

    其他資料目錄 直戳跳轉(zhuǎn) 單片機型號 測試條件 模塊名稱 代碼功能 STC89C52RC 晶振11.0592M SGP30氣體傳感器 模塊 STC89C52RC驅(qū)動SGP30氣體傳感器模塊串口與OLED0.96雙顯示 STM32F103C8T6 晶振8M/系統(tǒng)時鐘72M SGP30氣體傳感器模塊 STM32F103C8T6驅(qū)動SGP30氣體傳感器模塊串口與OLED0.96雙顯示 SGP30氣體傳

    2024年02月04日
    瀏覽(30)
  • K_A12_022 基于STM32等單片機驅(qū)動VL53L0X模塊 串口與OLED0.96雙顯示

    K_A12_022 基于STM32等單片機驅(qū)動VL53L0X模塊 串口與OLED0.96雙顯示

    注:偏差校準(zhǔn)步驟(均十六進制發(fā)送) 1、偏差校準(zhǔn)命令 A5 21 0A D0(此處是在10CM處校準(zhǔn)) 2、加載數(shù)據(jù)命令 A5 43 04 EC(斷電重啟后加載偏差補償) 3、保存設(shè)置命令 A5 87 01 2D(保存設(shè)置后生效) 單片機型號 測試條件 模塊名稱 代碼功能 STC89C52RC 晶振11.0592M VL53L0X模塊 STC89C52RC驅(qū)動VL53L0X模

    2024年02月13日
    瀏覽(26)
  • K_A35_017 基于STM32等單片機驅(qū)動TTP229矩陣觸摸傳感器 串口與OLED0.96雙顯示

    K_A35_017 基于STM32等單片機驅(qū)動TTP229矩陣觸摸傳感器 串口與OLED0.96雙顯示

    其他資料目錄 直戳跳轉(zhuǎn) 單片機型號 測試條件 模塊名稱 代碼功能 STC89C52RC 晶振11.0592M TTP229矩陣觸摸模塊 STC89C52RC驅(qū)動TTP229矩陣觸摸模塊 串口與OLED0.96雙顯示 STM32F103C8T6 晶振8M/系統(tǒng)時鐘72M TTP229矩陣觸摸模塊 STM32F103C8T6驅(qū)動TTP229矩陣觸摸模塊 串口與OLED0.96雙顯示 TTP229矩陣觸摸傳

    2024年02月02日
    瀏覽(25)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包