久久久久久久999_99精品久久精品一区二区爱城_成人欧美一区二区三区在线播放_国产精品日本一区二区不卡视频_国产午夜视频_欧美精品在线观看免费

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 2396|回復: 1
打印 上一主題 下一主題
收起左側

DSP28335驅動Lcd12864顯示Ds18b20采集到的溫度,并通過Sci傳輸至PC,使用Matlab制作...

[復制鏈接]
跳轉到指定樓層
樓主
ID:462570 發表于 2019-7-5 10:40 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
這是一個DSP28335驅動Lcd12864顯示Ds18b20采集到的溫度,并通過Sci方式傳輸至PC,使用Matlab制作上位機軟件進行數據保存與顯示的文章。
首先主要是為了彌補 CCS無法實時捕捉數據至上位機的缺陷(可能CCS有,但是我卻沒找到,如果有讀者知道具體答案,請留言告訴我。)。當然串口傳輸來的數據也有不足的地方,就是這些數據只能讓我們感性的觀看,如果想做數據分析,如FFT等,可能數據的采樣精度就不夠了。所以這也是一個不足的地方,希望日后能有解決的辦法。下面開始正文部分吧!
廢話不多說,先來張效果圖:
圖1是DSP_demo板加Lcd12864的顯示。顯示的比較粗糙,026.56就是26.56℃,一些細節沒有做好,主要是功能的實現。
圖2是使用Matlab2017b的AppDesigner制作的串口通信上位機軟件,具體功能有:發送(TX)、接收(RX)、實時繪圖、數據實時保存等。其中COM口和波特率需要設置,其他的如:數據位、校驗位、停止位等等,已經在代碼中默認設置了,因為只是這個小設計的定制版本,也沒有高興將所有功能都全部放置在界面上。
圖像中,出現了34℃,那是我用手拿住了 Ds18b20。目前是6月底,江蘇黃梅天,今天室溫就是27℃左右。
圖3是采集到的數據。只是展示了部分,剛開機的時候是沒有打開文本存儲按鈕的,因此第一個數據與圖2中接收數據框中前幾個數據不是對應的。​​​                                                      
效果展示完了,那么接下來就是代碼部分:
  1. /*
  2. * 功能:1.DS18B20進行溫度采集,并使用12864進行顯示
  3. *                 2.將采集到的溫度 通過SCIA傳輸,因為SCIB的9口被12864占用,所以不能用SCIB
  4. *                 3.SCIA使用CpuTimer0中斷,1s傳輸一次溫度數據給PC,未使用FIFO中斷
  5. * 波特率:9600  8位數據位,1位停止位,無校驗位
  6. */

  7. #include "DSP2833x_Project.h"
  8. #include "math.h"

  9. #include "lcd12864.h"
  10. #include "ds18b20_para.h"

  11. #define uchar  unsigned char

  12. void init_port(void);
  13. uchar Init_DS18B20();
  14. uchar ReadOneChar(void);
  15. void WriteOneChar(uchar dat);
  16. float ReadTemperature();
  17. void lcd_init(void);
  18. void lcd_write_cmd(uchar cmd);                        
  19. void lcd_write_dat(uchar dat);                        
  20. void LCD12864SetAddress_f( uchar x, uchar y );          //地址轉換
  21. void show(uchar x, uchar y, uchar * data);        

  22. void scia_init(void);
  23. void GPIO_init();
  24. interrupt void Timer0_ISR(void);

  25. uchar table[7];

  26. int main(void)
  27. {

  28.         float tt;
  29.         int tt1;

  30.         InitSysCtrl();

  31.         init_port();   //ds18b20 & 12864 端口初始化

  32.         DINT;
  33.         InitPieCtrl();        //初始化中斷控制
  34.         IER = 0x0000;
  35.         IFR = 0x0000;
  36.         InitPieVectTable();//初始化中斷矢量表

  37.         GPIO_init();  //配置端口為SCI

  38.         EALLOW;        // This is needed to write to EALLOW protected registers
  39.         PieVectTable.TINT0 = &Timer0_ISR;//將定時器0中斷服務函數入口放入中斷向量表
  40.         EDIS;   // This is needed to disable write to EALLOW protected registers

  41.         InitCpuTimers();
  42.         ConfigCpuTimer(&CpuTimer0, 150, 1000000);        //定時器0定時時間為 1s

  43.         scia_init();        //SCIA端口初始化

  44.         lcd_init();

  45.         PieCtrlRegs.PIECTRL.bit.ENPIE = 1;   // Enable the PIE block
  46.         PieCtrlRegs.PIEIER1.bit.INTx7=1;     // PIE Group 1, INT7
  47.         IER = 0x001;
  48.         EINT;


  49.         CpuTimer0Regs.TCR.bit.TSS = 0;  // 啟動定時器0

  50.         while (1)
  51.         {
  52.                 tt=ReadTemperature();
  53.                 tt1=tt*100+0.5;
  54.                 //留兩個小數點就*100,+0.5是四舍五入,因為C語言浮點數轉換為整型的時候把小數點
  55.                 //后面的數自動去掉,不管是否大于0.5,而+0.5之后大于0.5的就是進1了,小于0.5的就
  56.                 //算加上0.5,還是在小數點后面。

  57.                 table[0]=tt1/10000+0x30;  //百位
  58.                 table[1]=tt1%10000/1000+0x30;//十位
  59.                 table[2]=tt1%1000/100+0x30;//個位
  60.                 table[3]='.';
  61.                 table[4]=tt1%100/10+0x30;//十分位;
  62.                 table[5]=tt1%10+0x30;//百分位;
  63.                 table[6]='\0';  //用來中止一組顯示數據
  64.                 show(0,0,table);
  65.         }

  66. }

  67. //----------------------
  68. //--- 12864 及  DS18B20 的初始化
  69. //----------------------
  70. void init_port(void)
  71. {
  72.         EALLOW;
  73.                 GpioCtrlRegs.GPBPUD.bit.GPIO40 = 0;    // 使能GPIO10 引腳內部上拉

  74.                 GpioCtrlRegs.GPBMUX1.bit.GPIO40 =0;   // 配置GPIO10為通用I/O口

  75.                 GpioCtrlRegs.GPBQSEL1.bit.GPIO40 = 0;    // GPIO40與系統時鐘SYSCLKOUT 同步

  76.                 //lcd12864 use
  77.                 GpioCtrlRegs.GPAPUD.bit.GPIO0 = 0;    // 使能GPIO0 引腳內部上拉

  78.                 GpioCtrlRegs.GPAPUD.bit.GPIO1 = 1;   // 禁止GPIO1 引腳內部上拉
  79.                 GpioCtrlRegs.GPAQSEL1.all = 0x0000;    // GPIO0-GPIO15與系統時鐘SYSCLKOUT 同步

  80.                 GpioCtrlRegs.GPADIR.all = 0x003FF;// 配置GPIO0-GPIO9為輸出引腳

  81.                 //輸出數據LCD_RW和LCD_EN清零
  82.                 GpioDataRegs.GPADAT.bit.GPIO0 = 1;
  83.                 GpioDataRegs.GPADAT.bit.GPIO1 = 0;
  84.     EDIS;
  85. }

  86. //----------------------
  87. //---SCI的初始化
  88. //----------------------
  89. void GPIO_init()
  90. {
  91.         EALLOW;
  92.         GpioCtrlRegs.GPBPUD.bit.GPIO35 = 0;     // Enable pull-up for GPIO35  (SCITXDA)
  93.         GpioCtrlRegs.GPBMUX1.bit.GPIO35 = 1;    // GPIO35 for SCITXDA operation

  94.         GpioCtrlRegs.GPBPUD.bit.GPIO36 = 0;    // Enable pull-up for GPIO36 (SCIRXDA)
  95.         GpioCtrlRegs.GPBQSEL1.bit.GPIO36 = 3;  // Asynch input GPIO36 (SCIRXDA)
  96.         GpioCtrlRegs.GPBMUX1.bit.GPIO36 = 1;   // GPIO36 for SCIRXDA operation

  97.         EDIS;
  98. }



  99. void scia_init(void)
  100. {
  101.         SciaRegs.SCICCR.all =0x0007;    // 1 stop bit,
  102.                                                                       // No parity,8 char bits,
  103.                                                                       // async mode, idle-line protocol
  104.         SciaRegs.SCICTL1.all =0x0003;   // enable TX, RX, internal SCICLK,
  105.                                                                       // Disable RX ERR, SLEEP, TXWAKE

  106.         SciaRegs.SCIHBAUD    =0x0001;
  107.         SciaRegs.SCILBAUD    =0x00E7;   //構成 0x01e7=487 波特率計算為   37.5M/[(487+1)*8]=9605 近似等于9600

  108.         SciaRegs.SCICTL1.bit.SWRESET=1;//Relinquish SCI from Reset

  109. }

  110. interrupt void Timer0_ISR(void)
  111. {
  112.         int i=0;

  113.     while(table[i] != '\0')                        //不斷發送,直到1組溫度數據發送完畢
  114.     {
  115.             SciaRegs.SCITXBUF=table[i];  //發送數據
  116.             DELAY_US(1000);                                //若不加,會出現數據丟失
  117.             i++;
  118.     }

  119.     SciaRegs.SCITXBUF='\n';                        //每接收一組數據后,換行

  120.            PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;//PIE組1應答
  121. }
復制代碼

以上是DSP上的代碼。接下來是上位機代碼,供大家學習。這其中的一部分代碼,我也是從網上尋找來的,因此在此要感謝那位哥們開放的串口軟件。Appdesigner比較新,界面也不錯,如果大家喜歡,可以自己做出修改,但是我希望大家在我這個版本基礎上修改后,能在留言處開源自己的內容,讓大家一起進步。首先將app的鏈接給出:

鏈接:https://pan.baidu.com/s/1NEqKQJX87mv86V9ENZ2kkA
提取碼:x3y0

或  https://download.csdn.net/download/wx_simba/11259531





以下是代碼,有Matlab的朋友可以直接用 Appdesigner打開查看。注意,至少需要 2016a版本才具有Appdesigner功能。

***這是回頭打的字,插入代碼居然沒有Matlab的m語言格式。。。還有下面代碼看著多,其實估計80%都是系統生成的,我們是無法修改的,實現功能的代碼其實不多


  1. classdef app2 < matlab.apps.AppBase

  2.     % Properties that correspond to app components
  3.     properties (Access = public)
  4.         UIFigure             matlab.ui.Figure
  5.         pbOpenSerial         matlab.ui.control.StateButton
  6.         RXLabel              matlab.ui.control.Label
  7.         TXLabel              matlab.ui.control.Label
  8.         Label_RX             matlab.ui.control.Label
  9.         Label_TX             matlab.ui.control.Label
  10.         ReceiveView          matlab.ui.control.TextArea
  11.         Button_Send          matlab.ui.control.Button
  12.         transmitView         matlab.ui.control.TextArea
  13.         Button_Clear         matlab.ui.control.Button
  14.         DropDownLabel        matlab.ui.control.Label
  15.         ppCOM                matlab.ui.control.DropDown
  16.         Label                matlab.ui.control.Label
  17.         Label_2              matlab.ui.control.Label
  18.         Lamp                 matlab.ui.control.Lamp
  19.         Label_3              matlab.ui.control.Label
  20.         ppCOM_2              matlab.ui.control.DropDown
  21.         Panel                matlab.ui.container.Panel
  22.         Label_5              matlab.ui.control.Label
  23.         txtStoreSwich        matlab.ui.control.Switch
  24.         Label_6              matlab.ui.control.Label
  25.         txtStoreFlag         matlab.ui.control.Lamp
  26.         UIAxes               matlab.ui.control.UIAxes
  27.         UartsEditFieldLabel  matlab.ui.control.Label
  28.         UartsEditField       matlab.ui.control.NumericEditField
  29.     end

  30.    
  31.     properties (Access = public)
  32.         COM;    % 端口號
  33.         Baud_Rate; %波特率
  34.         s  ;    %端口設置句柄
  35.         RX_num; %接收統計
  36.         TX_num; %發送統計
  37.         RX_once;%一次接收的數據
  38.         RX_Date;%接收的所有數據
  39.         is_open;%是否打開串口標志位
  40.         Flag_i %繪圖橫坐標的點
  41.         
  42.     end
  43.    
  44.    
  45.    
  46.     methods (Access = public)
  47.         function  EveBytesAvailableFcn(app, src, event)
  48.             n = src.BytesAvailable;%獲取接收到的字符個數
  49.             if n>0%n>0才繼續執行,因為0也會觸發中斷
  50.                 app.RX_num=app.RX_num+n;
  51.                 app.Label_RX.Text=num2str(app.RX_num);%將數字轉化為字符串輸出
  52.                 app.RX_once=fread(src,n,'uchar');%讀取函數,讀取后矩陣為一列
  53.                 app.RX_Date =strcat(app.RX_Date, app.RX_once');%字符串拼接,需要轉置化為一行
  54.                 app.ReceiveView.Value= app.RX_Date;%textarea的設置格式為cell,或單行字符串
  55.                 app.Flag_i=app.Flag_i+1;
  56.                 t=app.Flag_i*app.UartsEditField.Value;
  57.                 y=str2double(char(app.RX_once'));   
  58.                 plot(app.UIAxes,t,y,'marker','+','linewidth',5,'linestyle','--');
  59.                 hold(app.UIAxes,'on');
  60.                
  61.                 if strcmp(app.txtStoreSwich.Value,'On')
  62.                     app.txtStoreFlag.Color=[0 1 0];
  63.                     name_ref=['wx',datestr(now,29),'.txt']; % name_ref=['wx',datestr(now,29),'.xls'];
  64.                     fid = fopen(name_ref,'a'); %fid = fopen('c.xls','a');
  65.                     fprintf(fid,'%s\r\n',app.RX_once');  %需要轉置,進行換行處理,txt換行 要\r\n..xls只\n就可以換行
  66.                     fclose(fid);
  67.                 else
  68.                     app.txtStoreFlag.Color=[0 0 0];
  69.                 end
  70.             end
  71.         end
  72.         
  73.     end
  74.    
  75.    
  76.     methods (Access = private)
  77.         % Code that executes after component creation
  78.         function startupFcn(app)
  79.             app.RX_num=0;
  80.             app.TX_num=0;
  81.             app.is_open=0;
  82.             app.Flag_i=0;
  83.             scoms = instrfind;%獲取占用的串口號
  84.             if scoms ~= 0%如果存在則關閉,否則不能打開
  85.                 stopasync(scoms);
  86.                 fclose(scoms);
  87.                 delete(scoms);
  88.             end
  89.             
  90.             
  91.         end
  92.         % Button pushed function: Button_Send
  93.         function Button_SendPushed(app, event)
  94.             val=app.transmitView.Value;
  95.             if length(val{1})>0%textarea控件是cell格式,獲取需要用{1}
  96.                 app.TX_num=app.TX_num+length(val{1});
  97.                 app.Label_TX.Text=num2str(app.TX_num);
  98.                 fwrite(app.s, char(val), 'uint8', 'async');%需要將val轉化為char
  99.             end
  100.         end
  101.         % Value changed function: pbOpenSerial
  102.         function pbOpenSerialValueChanged2(app, event)
  103.             
  104.             app.COM=get(app.ppCOM,'Value');
  105.             app.Baud_Rate=get(app.ppCOM_2,'Value');
  106.             if strcmp(get(app.pbOpenSerial,'Text'),'打開串口')
  107.                 try
  108.                     app.s=serial(app.COM);
  109.                     app.s.BaudRate=str2double(app.Baud_Rate);%設置波特率,str2double 很重要
  110.                     app.s.DataBits=8;%設置數據長度
  111.                     app.s.StopBits=1;%設置停止位長度
  112.                     app.s.InputBufferSize=1024000;%設置輸入緩沖區大小為1M
  113.                     app.s.BytesAvailableFcnMode='byte';  %串口事件回調設置
  114.                     %  app.s.Terminator='CR/LF';
  115.                     app.s.BytesAvailableFcnCount=1; %輸入緩沖區存在10個字節觸發回調函數
  116.                     app.s.BytesAvailableFcn={@app.EveBytesAvailableFcn};%回調函數的指定
  117.                     
  118.                     fopen(app.s);%打開串口
  119.                     app.is_open=1;
  120.                     app.pbOpenSerial.Text='關閉串口';
  121.                     app.Lamp.Color=[0 1 0];
  122.                 catch err
  123.                     msgbox('打開失敗');
  124.                 end
  125.             else
  126.                 try
  127.                     fclose(app.s);
  128.                     app.pbOpenSerial.Text='打開串口';
  129.                     app.Lamp.Color=[0.15 0.15 0.15];
  130.                 catch err
  131.                     msgbox('關閉失敗');
  132.                 end
  133.                 delete(app.s);
  134.                 app.is_open=0;
  135.             end
  136.         end
  137.         % Close request function: UIFigure
  138.         function UIFigureCloseRequest(app, event)
  139.             delete(app)
  140.             
  141.         end
  142.         % Button pushed function: Button_Clear
  143.         function Button_ClearPushed(app, event)
  144.             app.RX_Date ='';
  145.             app.ReceiveView.Value= app.RX_Date;
  146.             app.TX_num=0;
  147.             app.RX_num=0;
  148.             app.Label_TX.Text=num2str(app.TX_num);
  149.             app.Label_RX.Text=num2str(app.RX_num);
  150.             cla(app.UIAxes,'reset');
  151.         end
  152.         % Value changed function: txtStoreSwich
  153.         function txtStoreSwichValueChanged(app, event)
  154.             value = app.txtStoreSwich.Value;
  155.             if strcmp(value,'On')
  156.                 app.txtStoreFlag.Color=[0 1 0];
  157.             else
  158.                 app.txtStoreFlag.Color=[0 0 0];
  159.             end
  160.         end
  161.     end
  162.     % App initialization and construction
  163.     methods (Access = private)
  164.         % Create UIFigure and components
  165.         function createComponents(app)
  166.             % Create UIFigure
  167.             app.UIFigure = uifigure;
  168.             app.UIFigure.Position = [500 300 895 521];
  169.             app.UIFigure.Name = 'UI Figure';
  170.             app.UIFigure.CloseRequestFcn = createCallbackFcn(app, @UIFigureCloseRequest, true);
  171.             % Create pbOpenSerial
  172.             app.pbOpenSerial = uibutton(app.UIFigure, 'state');
  173.             app.pbOpenSerial.ValueChangedFcn = createCallbackFcn(app, @pbOpenSerialValueChanged2, true);
  174.             app.pbOpenSerial.Text = '打開串口';
  175.             app.pbOpenSerial.FontSize = 16;
  176.             app.pbOpenSerial.FontWeight = 'bold';
  177.             app.pbOpenSerial.Position = [740 311 81 27];
  178.             % Create RXLabel
  179.             app.RXLabel = uilabel(app.UIFigure);
  180.             app.RXLabel.Position = [42 60 25 15];
  181.             app.RXLabel.Text = 'RX:';
  182.             % Create TXLabel
  183.             app.TXLabel = uilabel(app.UIFigure);
  184.             app.TXLabel.Position = [102 60 25 15];
  185.             app.TXLabel.Text = 'TX:';
  186.             % Create Label_RX
  187.             app.Label_RX = uilabel(app.UIFigure);
  188.             app.Label_RX.Position = [66 60 37 15];
  189.             app.Label_RX.Text = '0';
  190.             % Create Label_TX
  191.             app.Label_TX = uilabel(app.UIFigure);
  192.             app.Label_TX.Position = [126 60 82 15];
  193.             app.Label_TX.Text = '0';
  194.             % Create ReceiveView
  195.             app.ReceiveView = uitextarea(app.UIFigure);
  196.             app.ReceiveView.Position = [25 192 161 270];
  197.             % Create Button_Send
  198.             app.Button_Send = uibutton(app.UIFigure, 'push');
  199.             app.Button_Send.ButtonPushedFcn = createCallbackFcn(app, @Button_SendPushed, true);
  200.             app.Button_Send.FontSize = 16;
  201.             app.Button_Send.FontWeight = 'bold';
  202.             app.Button_Send.Position = [716 96 100 27];
  203.             app.Button_Send.Text = '發送';
  204.             % Create transmitView
  205.             app.transmitView = uitextarea(app.UIFigure);
  206.             app.transmitView.Position = [27 88 159 60];
  207.             % Create Button_Clear
  208.             app.Button_Clear = uibutton(app.UIFigure, 'push');
  209.             app.Button_Clear.ButtonPushedFcn = createCallbackFcn(app, @Button_ClearPushed, true);
  210.             app.Button_Clear.FontSize = 16;
  211.             app.Button_Clear.FontWeight = 'bold';
  212.             app.Button_Clear.Position = [716 49 100 27];
  213.             app.Button_Clear.Text = '清空';
  214.             % Create DropDownLabel
  215.             app.DropDownLabel = uilabel(app.UIFigure);
  216.             app.DropDownLabel.HorizontalAlignment = 'right';
  217.             app.DropDownLabel.FontName = 'Calibri';
  218.             app.DropDownLabel.FontSize = 18;
  219.             app.DropDownLabel.Position = [684 422 41 24];
  220.             app.DropDownLabel.Text = '串口';
  221.             % Create ppCOM
  222.             app.ppCOM = uidropdown(app.UIFigure);
  223.             app.ppCOM.Items = {'COM1', 'COM2', 'COM3', 'COM4'};
  224.             app.ppCOM.FontName = 'Calibri';
  225.             app.ppCOM.FontSize = 18;
  226.             app.ppCOM.Position = [740 424 76 25];
  227.             app.ppCOM.Value = 'COM1';
  228.             % Create Label
  229.             app.Label = uilabel(app.UIFigure);
  230.             app.Label.FontSize = 18;
  231.             app.Label.FontWeight = 'bold';
  232.             app.Label.Position = [39 475 42 23];
  233.             app.Label.Text = '接收';
  234.             % Create Label_2
  235.             app.Label_2 = uilabel(app.UIFigure);
  236.             app.Label_2.FontSize = 18;
  237.             app.Label_2.FontWeight = 'bold';
  238.             app.Label_2.Position = [39 151 42 23];
  239.             app.Label_2.Text = '發送';
  240.             % Create Lamp
  241.             app.Lamp = uilamp(app.UIFigure);
  242.             app.Lamp.Position = [695 317 20 20];
  243.             app.Lamp.Color = [0.149 0.149 0.149];
  244.             % Create Label_3
  245.             app.Label_3 = uilabel(app.UIFigure);
  246.             app.Label_3.HorizontalAlignment = 'right';
  247.             app.Label_3.FontName = 'Calibri';
  248.             app.Label_3.FontSize = 18;
  249.             app.Label_3.Position = [682 373 59 24];
  250.             app.Label_3.Text = '波特率';
  251.             % Create ppCOM_2
  252.             app.ppCOM_2 = uidropdown(app.UIFigure);
  253.             app.ppCOM_2.Items = {'300', '600', '1200', '2400', '4800', '9600', '19200', '38400', '115200'};
  254.             app.ppCOM_2.FontName = 'Calibri';
  255.             app.ppCOM_2.FontSize = 18;
  256.             app.ppCOM_2.Position = [756 375 60 25];
  257.             app.ppCOM_2.Value = '9600';
  258.             % Create Panel
  259.             app.Panel = uipanel(app.UIFigure);
  260.             app.Panel.Position = [655 173 231 87];
  261.             % Create Label_5
  262.             app.Label_5 = uilabel(app.Panel);
  263.             app.Label_5.HorizontalAlignment = 'center';
  264.             app.Label_5.Position = [136 24 77 15];
  265.             app.Label_5.Text = '文本存儲按鈕';
  266.             % Create txtStoreSwich
  267.             app.txtStoreSwich = uiswitch(app.Panel, 'slider');
  268.             app.txtStoreSwich.ValueChangedFcn = createCallbackFcn(app, @txtStoreSwichValueChanged, true);
  269.             app.txtStoreSwich.Position = [151 54 45 20];
  270.             % Create Label_6
  271.             app.Label_6 = uilabel(app.Panel);
  272.             app.Label_6.HorizontalAlignment = 'right';
  273.             app.Label_6.Position = [26 24 77 15];
  274.             app.Label_6.Text = '文本存儲指示';
  275.             % Create txtStoreFlag
  276.             app.txtStoreFlag = uilamp(app.Panel);
  277.             app.txtStoreFlag.Position = [52 45 29 29];
  278.             app.txtStoreFlag.Color = [0 0 0];
  279.             % Create UIAxes
  280.             app.UIAxes = uiaxes(app.UIFigure);
  281.             title(app.UIAxes, 'Figure')
  282.             xlabel(app.UIAxes, 'time')
  283.             ylabel(app.UIAxes, 'Y')
  284.             app.UIAxes.LineStyleOrder = {'- '};
  285.             app.UIAxes.NextPlot = 'add';
  286.             app.UIAxes.Position = [197 46 445 438];
  287.             % Create UartsEditFieldLabel
  288.             app.UartsEditFieldLabel = uilabel(app.UIFigure);
  289.             app.UartsEditFieldLabel.HorizontalAlignment = 'right';
  290.             app.UartsEditFieldLabel.Position = [262 18 121 15];
  291.             app.UartsEditFieldLabel.Text = 'Uart發送數據的周期/s';
  292.             % Create UartsEditField
  293.             app.UartsEditField = uieditfield(app.UIFigure, 'numeric');
  294.             app.UartsEditField.Limits = [0 Inf];
  295.             app.UartsEditField.Position = [398 14 49 22];
  296.             app.UartsEditField.Value = 1;
  297.         end
  298.     end
  299.     methods (Access = public)
  300.         % Construct app
  301.         function app = app2
  302.             % Create and configure components
  303.             createComponents(app)
  304.             % Register the app with App Designer
  305.             registerApp(app, app.UIFigure)
  306.             % Execute the startup function
  307.             runStartupFcn(app, @startupFcn)
  308.             if nargout == 0
  309.                 clear app
  310.             end
  311.         end
  312.         % Code that executes before app deletion
  313.         function delete(app)
  314.             % Delete UIFigure when app is deleted
  315.             delete(app.UIFigure)
  316.         end
  317.     end
  318. end
復制代碼
分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享淘帖 頂 踩
回復

使用道具 舉報

沙發
ID:595122 發表于 2019-9-7 14:54 | 只看該作者
樓主有頭文件嗎 那個math~
回復

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

手機版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術交流QQ群281945664

Powered by 單片機教程網

快速回復 返回頂部 返回列表
主站蜘蛛池模板: 国产精品精品3d动漫 | 91av视频在线 | 久久国产婷婷国产香蕉 | 久久99久久98精品免观看软件 | 国产精品久久久久久久久久久新郎 | 成人在线欧美 | 99中文字幕 | 9191在线观看 | 一级毛片成人免费看a | 精品美女在线观看视频在线观看 | 国产精品一区一区 | 亚洲精品日韩一区二区电影 | 国产亚洲精品精品国产亚洲综合 | 精品国产区 | 欧美日韩在线精品 | 午夜精品| 国产成人免费视频网站高清观看视频 | 成人a视频片观看免费 | 欧美一级二级三级视频 | 亚洲综合在线播放 | 天天玩天天干天天操 | 999精彩视频 | 国产精品综合久久 | 九九精品在线 | 中文字幕日韩三级 | 五月槐花香 | 999久久久久久久久6666 | 九九色综合 | 91亚洲精品久久久电影 | 四虎在线观看 | 国产精品久久久久久久久久久免费看 | 99久久婷婷国产综合精品 | av看看| 精品视频网 | 国产精品伦理一区二区三区 | 久久国产区 | 风间由美一区二区三区在线观看 | 午夜视频网站 | 国产一级片免费视频 | www.99热| h肉视频 |