test
Dependencies: ad5422_arduino mbed LT1446 ADS1248-1 LM35-1 Flash FT813 PGA280_ADS1259
Diff: main.cpp
- Revision:
- 7:c364201bc3ed
- Parent:
- 6:cfe7cb0bdb1a
--- a/main.cpp Fri Aug 14 14:16:03 2020 +0000 +++ b/main.cpp Tue Sep 01 10:52:34 2020 +0000 @@ -34,10 +34,10 @@ Ticker PID2; //ПИД для расхода /*Конец*/ //InterruptIn button(USER_BUTTON); -InterruptIn ADSRdy(PG_3); +InterruptIn ADSRdy(D8); //настройка SPI для дисплея -FT813 TFT (D11, D12, D13, D10, D9, D8); //mosi, miso, sck, ss, int, pd +FT813 TFT (PC_12, PC_11, PC_10, PD_2, PG_2, PG_3); //mosi, miso, sck, ss, int, pd Display disp(&TFT); //конец @@ -417,7 +417,7 @@ disp.pressedButton = NONE_PRESS; disp.str_edit[0]='_'; disp.cursor=0; - + uint32_t XY=0; //ADS1248CalibrateSoft(&ads1,BufToFloat); //эксперимент // change active screen depending on pressed area @@ -425,17 +425,32 @@ if(TFT.IsOn())//проверка включения дисплея { - disp.pressedButton = disp.GetTouch(); + //получение координат касания + /*XY=TFT.GetTouchTagXY(); + disp.TouchX=-(uint16_t)((XY>>16)*0xFFFF); + disp.TouchY=-(uint16_t)(XY*0xFFFF);*/ + disp.TouchX=TFT.GetTouchTagX(); + disp.TouchY=TFT.GetTouchTagY();; + disp.pressedButton=TFT.GetTouchTag(); + if(disp.TouchX==-32768&&disp.TouchY==-32768) + disp.pressedButton = NONE_PRESS; + else UART.printf("X %d | Y %d\r\n",disp.TouchX,disp.TouchY); + wait_ms(35); + + //-------------------------------ChromTestScreen------------------------ if (disp.activeScreen == TEST_CHROM_SCREEN) { disp.ChromTest(LM35_0.temp,RAS.temp,temp,rashod_u); - if(disp.pressedButton){ - wait_ms(100); + if(disp.pressedButton){ if(disp.pressedButton==CHROM_TEMP_PRESS){ disp.pressedButton = NONE_PRESS; disp.activeScreen=MENU_SCREEN; } + if(disp.pressedButton==PID_MENU_PRESS){ + disp.pressedButton=NONE_PRESS; + disp.activeScreen=PID_SCREEN; + } } } // --------------------------------------------------------------------- @@ -445,7 +460,7 @@ disp.selectedEditor=(selectedEditor_t)disp.pressedButton; // else disp.selectedEditor=(selectedEditor_t)NONE_PRESS; disp.PidScreen(&BufToFloat,LM35_0.temp,RAS.temp,LT1446_0.dacB.Code,LT1446_0.dacA.Code,&Mem.PID,&Mem.PID_R);} - wait_ms(100); + if(disp.pressedButton==SAVE_PRESS) { Mem_write();//сохраняем настройки @@ -501,7 +516,7 @@ if (disp.activeScreen == MENU_SCREEN) { disp.MainMenu(LM35_0.temp, LM35_0.temp);//сюда писать значения (наверное) (расход/температура) if (disp.pressedButton) { - wait_ms(150); + //wait_ms(150); if (disp.pressedButton == CURR_TEMP_PRESS) { disp.activeScreen = CURR_TEMP_SCREEN; } else if (disp.pressedButton == CURR_HUM_PRESS) {