码迷,mamicode.com
首页 > 其他好文 > 详细

串口数据画图小工具

时间:2015-10-16 15:00:13      阅读:922      评论:0      收藏:0      [点我收藏+]

标签:

1、SerialChart

预览

技术分享

 

配置文件

[_setup_]

port=COM5

baudrate=57600

width=1000

height=200

background_color = white

 

grid_h_origin = 100

grid_h_step = 10

grid_h_color = gray

grid_h_origin_color = black

 

grid_v_origin = 10

grid_v_step = 10

grid_v_color = gray

grid_v_origin_color = red

 

[_default_]

min=-1024

max=1024

 

[Field1]

color=green

 

[Field2]

color=blue

 

[Field3]

color=red


串口发送实例

    //x轴
    USART_Tx(USART0,0x31);
    USART_Tx(USART0,0x31);
    USART_Tx(USART0,0x30);
    USART_Tx(USART0,0x2c);
    
    //y轴
    USART_Tx(USART0,0x36);
    USART_Tx(USART0,0x30);
    USART_Tx(USART0,0x37);
    USART_Tx(USART0,0x2c);
    
    //z轴
    USART_Tx(USART0,0x31);
    USART_Tx(USART0,0x30);
    USART_Tx(USART0,0x32);
    USART_Tx(USART0,0x30);
    
    USART_Tx(USART0,0x0d);
    USART_Tx(USART0,0x0a);
    


2、ComAssistant

预览

技术分享

通信协议 0xfc data 0x00 0x05

eg:16bit数据分4次发送,高位在前

    USART_Tx(USART0,0xfc);   
    USART_Tx(USART0,ChartoAscii((unsigned char)(hand_sup_curr_data>>12)&0xf));             
    USART_Tx(USART0,ChartoAscii((unsigned char)(hand_sup_curr_data>>8)&0xf)); 
    USART_Tx(USART0,ChartoAscii((unsigned char)(hand_sup_curr_data>>4)&0xf)); 
    USART_Tx(USART0,ChartoAscii((unsigned char)(hand_sup_curr_data)&0xf));                     
    USART_Tx(USART0,ChartoAscii(0x00)); 
    USART_Tx(USART0,ChartoAscii(0x05)); 

 

串口数据画图小工具

标签:

原文地址:http://www.cnblogs.com/dong1/p/4885213.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!