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/app1_usb_watt_meter/src/echonet_main.c

    r364 r374  
    905905static uint8_t main_read_button(analogin_t *obj)
    906906{
    907         float a = analogin_read(obj);
    908 
    909         a *= 5.0;
     907        int a = analogin_read_u16(obj);
     908
     909        a *= 5;
    910910
    911911        //printf("Button read analog = %f\r\n",a);
    912         if (a < 0.2)
     912        if (a < (int)(0.2 * 65536))
    913913                return BUTTON_DOWN;
    914         if (a < 1.0)
     914        if (a < (int)(1.0 * 65536))
    915915                return BUTTON_RIGHT;
    916         if (a < 1.7)
     916        if (a < (int)(1.7 * 65536))
    917917                return BUTTON_SELECT;
    918         if (a < 2.6)
     918        if (a < (int)(2.6 * 65536))
    919919                return BUTTON_UP;
    920         if (a < 4.6)
     920        if (a < (int)(4.6 * 65536))
    921921                return BUTTON_LEFT;
    922922        else
Note: See TracChangeset for help on using the changeset viewer.