@恒伯利亚狼 发表于 2019-6-14 17:40:43

dsp28335如何在lcd1602上显示变量

/*
* main.c
*
*Created on: 2018-3-21
*      Author: Administrator
*/


#include "DSP2833x_Device.h"   // DSP2833x Headerfile Include File
#include "DSP2833x_Examples.h"   // DSP2833x Examples Include File

#include "leds.h"
#include "smg.h"
#include "uart.h"
#include "stdio.h"
#include "lcd1602.h"
#include "adc.h"
#include "time.h"




/*******************************************************************************
* 函 数 名         : main
* 函数功能                   : 主函数
* 输    入         : 无
* 输    出         : 无
*******************************************************************************/
void main()
{
        char *table;
        float adc_vol;
//        char *str;

        InitSysCtrl();
        InitPieCtrl();
        IER = 0x0000;
        IFR = 0x0000;
        InitPieVectTable();

        LED_Init();
        TIM0_Init(150,200000);//200ms
        UARTa_Init(4800);
        LCD1602_Init();
        SMG_Init();
        ADC_Init();
        LCD1602_DispString(1," WELCOME.TO YOU! ");
//        LCD1602_DispStringEx(2,1,"123456789");

        while(1)
        {


                adc_vol=(float)Read_ADCValue()*3.0/4096;
                SMG_DisplayFloat(adc_vol,2);
        //        SMG_DisplayInt(Read_ADCValue());
                //*table=adc_vol*100;
                LCD1602_DispStringEx(2,1,adc_vol);
                DELAY_US(10);
        }
}

这是我修改的程序,想让液晶屏显示ADC模块的电压值,但是程序有错误,想请大家帮我看看
页: [1]
查看完整版本: dsp28335如何在lcd1602上显示变量