Ignore:
Timestamp:
Apr 5, 2019, 9:26:53 PM (5 years ago)
Author:
coas-nagasima
Message:

mbed関連を更新
シリアルドライバをmbedのHALを使うよう変更
ファイルディスクリプタの処理を更新

File:
1 edited

Legend:

Unmodified
Added
Removed
  • asp3_tinet_ecnl_arm/trunk/app4_aircon/src/echonet_main.c

    r364 r374  
    10911091static uint8_t main_read_button(analogin_t *obj)
    10921092{
    1093         float a = analogin_read(obj);
    1094 
    1095         a *= 5.0;
     1093        int a = analogin_read_u16(obj);
     1094
     1095        a *= 5;
    10961096
    10971097        //printf("Button read analog = %f\r\n",a);
    1098         if (a < 0.2)
     1098        if (a < (int)(0.2 * 65536))
    10991099                return BUTTON_DOWN;
    1100         if (a < 1.0)
     1100        if (a < (int)(1.0 * 65536))
    11011101                return BUTTON_RIGHT;
    1102         if (a < 1.7)
     1102        if (a < (int)(1.7 * 65536))
    11031103                return BUTTON_SELECT;
    1104         if (a < 2.6)
     1104        if (a < (int)(2.6 * 65536))
    11051105                return BUTTON_UP;
    1106         if (a < 4.6)
     1106        if (a < (int)(4.6 * 65536))
    11071107                return BUTTON_LEFT;
    11081108        else
Note: See TracChangeset for help on using the changeset viewer.