çºè¡ãµã€ã¯ã«ã®å 容ïŒ
- [ããŒã1]䜿çšããããœãããŠã§ã¢ããã³ããŒããŠã§ã¢ãœãªã¥ãŒã·ã§ã³ã®æŠèŠã
- [ããŒã2] FT800ã°ã©ãã£ãã¯ã¹ã³ã³ãããŒã©ãŒå ¥éã åšèŸºæ©åšã«æ¢è£œã®mbedã©ã€ãã©ãªã䜿çšããŸãã
- [ããŒã3] HYT-271ã»ã³ãµãŒã®æ¥ç¶ã åšèŸºæ©åšçšã®ç¬èªã®ã©ã€ãã©ãªãmbedã§äœæããŠå ¬éããŸãã
- [ããŒã4]ã¢ããªã±ãŒã·ã§ã³éçºïŒããã°ã©ã æ§é ãã¿ããã¹ã¯ãªãŒã³ã§ã®äœæ¥ã
- [ããŒã5]ã¢ããªã±ãŒã·ã§ã³éçºïŒç»åã®è¡šç€ºããã·ã¢åã®åé¡ã
- [ããŒã6]ããŠãžã³ã°éšåã®å°å·
åã®3ã€ã®èšäºã®çµæã«åºã¥ããŠãmbed-projectãåãåããŸãããããã¯ãSPIããã³I2Cã€ã³ã¿ãŒãã§ã€ã¹ãšARM mbedã§ã®ãµããŒããåããä»»æã®ãããã°ããŒãã®åäœãã¡ãŒã ãŠã§ã¢ã«ã³ã³ãã€ã«ã§ããããã°ã©ã ã§ãã ãã¹ã察象ã¯ãSilicon Labsã®SLSTK3400Aãããã°ããŒããAtmelã®ATSAMD21-XPROãWiznetã®WIZwiki-W7500Pã§ããã
å®è£ ãããããã°ã©ã ã¯ãHYT枩床ããã³çžå¯Ÿæ¹¿åºŠã»ã³ãµãŒãããŒãªã³ã°ãã枬å®çµæãRiverdi TFTãã£ã¹ãã¬ã€ã«åºåãããšãã2ã€ã®ã¿ã¹ã¯ãå®è¡ããŸãã ãããžã§ã¯ãã¯developer.mbed.orgã§å ¥æã§ããŸãã
æ¬æ¥ãåºæ¬ãããžã§ã¯ãã®æ¡åŒµãéå§ããŸã-åäžã®äœæ¥ç»é¢ã®ä»£ããã«ãã¡ãã¥ãŒãšããã€ãã®ãµãã»ã¯ã·ã§ã³ã衚瀺ããããããã®éã§ã¿ããã€ã³ã¿ãŒãã§ã€ã¹ã䜿çšããŠåãæ¿ããããšãã§ããŸãã
1. TFTã¢ãžã¥ãŒã«ã®æ§é
ãã®ããã䜿çšãããRiverdi TFTã¢ãžã¥ãŒã«ã¯ããã£ã¹ãã¬ã€èªäœãFTDIã®FTDxxã·ãªãŒãºã°ã©ãã£ãã¯ã³ã³ãããŒã©ãŒãããã³ã¿ããã³ã³ãããŒã©ãŒããªãŒãã£ãªã³ã³ãããŒã©ãŒãªã©ã®è¿œå ã³ã³ããŒãã³ãã§æ§æãããŠããŸãã ã¡ãŒã«ãŒã®ãŠã§ããµã€ãã§å©çšå¯èœãªTFTã¢ãžã¥ãŒã«ã®å®å šãªãªã¹ããèŠã€ããããšãã§ããETF ãŠã§ããµã€ãã§å庫ããå©çšå¯èœãªããžã·ã§ã³ãšçŸåšã®äŸ¡æ ŒãèŠã€ããããšãã§ããŸãã
ãã£ã¹ãã¬ã€ã¯ã察è§ç·ã解å床ãæãããããã¯ã©ã€ãã®ã¿ã€ããåãä»ããŸãã¯è£ 食ãã¬ãŒã ã®ååšãã¿ããã¹ã¯ãªãŒã³ã®ã¿ã€ããç°ãªããŸã-容éæ§ããã³æµææ§TFTãšãã¿ããå ¥åããµããŒãããªããã£ã¹ãã¬ã€ã補é ãããŸãã çµ±åã°ã©ãã£ãã¯ã¹ã³ã³ãããŒã©ãŒã¯ãã£ã¹ãã¬ã€æ©èœãšäžèŽããŸããFT800ã³ã³ãããŒã©ãŒã¯æµæãã£ã¹ãã¬ã€çšãFT801ã¯å®¹éæ§ãã£ã¹ãã¬ã€çšãå€ãFT81xã¢ãã«ã¯æ¯èŒçé«è§£å床ããã³ãã®ä»ã®è¿œå æ©èœããµããŒãããŠããŸãã
ç§ã¯ãé»ã®è£ 食çãªãã¬ãŒã ã§äœããã4.3 ''ã®å¯Ÿè§ç·ãæã€uxTouchã·ãªãŒãºã®ããããRVT43ULFNWC00ã¢ãžã¥ãŒã«ã䜿çšããŸãã ã¢ãžã¥ãŒã«ã«ã¯éé»å®¹éåŒã¿ããã¹ã¯ãªãŒã³ããããããã«å¿ããŠçµ±åã°ã©ãã£ãã¯ã³ã³ãããŒã©ãŒFT801ããããŸãã
Riverdi TFTã¢ãžã¥ãŒã«ã®å¶åŸ¡æé ã«ã€ããŠã¯ãã§ã«èª¬æããŸãããå¶åŸ¡ã³ã³ãããŒã©ãŒã¯FT801ãããã«æ¥ç¶ãããã°ã©ãã£ãã¯ã³ã³ãããŒã©ãŒãšç°¡åãªã³ãã³ãã亀æããŸããã€ãŸããç¹å®ã®FT801ã¬ãžã¹ã¿ãèªã¿æžãããŸãã ã³ã³ãããŒã«ã³ã³ãããŒã©ãŒããåä¿¡ããã³ãã³ãã«åŸã£ãŠãã°ã©ãã£ãã¯ã³ã³ãããŒã©ãŒã¯ãã£ã¹ãã¬ã€ãšå¯Ÿè©±ããŸããç»åãæç»ããã³è¡šç€ºããã¿ããå ¥åãšãªãŒãã£ãªãã£ãã«ã®æäœãå®è£ ããŸãã
容éæ§TFTã¢ãžã¥ãŒã«ã§ã¯ãæµæã¹ã¯ãªãŒã³ãåããã¢ãã«ãšã¯ç°ãªããåå¥ã®ã¿ããããã«ã³ã³ãããŒã©ãŒãã€ã³ã¹ããŒã«ãããŸãã ãã ãããã®è¿œå ã®ããŒããŠã§ã¢ãŠãããã®ååšã¯ãããã°ã©ããŒã®èŠ³ç¹ããTFTå¶åŸ¡ããã»ã¹ã«åœ±é¿ããŸããã
2.ã¿ããããŒã¿ã®ååŸ
FT801ã°ã©ãã£ãã¯ã³ã³ãããŒã©ãŒã¯ãæšæºããã³é«åºŠãªã¿ããå ¥åã¢ãŒãã®äž¡æ¹ããµããŒãããŠããŸãã æåã®ã±ãŒã¹ã§ã¯ãã·ã³ã°ã«ã¿ããã®ã¿ãæ€åºã§ããé«åºŠãªã¢ãŒãã§ã¯ãã«ãã¿ããããµããŒããããŸãã 䜿çšãããåäœã¢ãŒãã¯ãREG_CTOUCH_EXTENDEDã¬ãžã¹ã¿ã®å€ã«ãã£ãŠæ±ºãŸããŸãã
- 0ïŒæ¡åŒµã¢ãŒã
- 1ïŒFT800äºæã¢ãŒã-æšæºã®ã·ã³ã°ã«ã¿ããã¢ãŒããããã©ã«ãã¢ãŒãã§ãã
ç§ã¯ã·ã³ã°ã«ã¿ããã¢ãŒãã®ã¿ã䜿çšããŸãã 第äžã«ãç§ã®ã¢ããªã±ãŒã·ã§ã³ã«ãšã£ãŠããã®æ©èœã¯éåžžã«ååã§ããã第äºã«ããã®æ¹æ³ã¯FT800ããŒã¹ã®ã¢ãžã¥ãŒã«ãšäºææ§ããããŸãã
TFTãã£ã¹ãã¬ã€ãã¿ããããããšãã¿ããããã«ã³ã³ãããŒã©ãŒã¯ã¿ããé åã®ãçãããŒã¿ãFT801ã«éä¿¡ããŸãã ãã®ããŒã¿ã¯ãã°ã©ãã£ãã¯ã³ã³ãããŒã©ãŒã®REG_CTOUCH_RAW_XYã¬ãžã¹ã¿ã«æžã蟌ãŸããŸãããã®åŸãFT801ã¯ã¿ãã座æšïŒxãyïŒãèšç®ããçµæãREG_TOUCH_TAG_XYã¬ãžã¹ã¿ã«æ ŒçŽããŸãã 座æšèšç®ã¯ãREG_CTOUCH_RAW_XYããã®ããŒã¿ãšåº§æšãããªãã¯ã¹ãæ ŒçŽããããããªãã¯ã¹å€æã§ãããREG_CTOUCH_TRANSFORM_AããREG_CTOUCH_TRANSFORM_FãŸã§ã®ã¬ãžã¹ã¿ãŒã«æ ŒçŽãããŸãã REG_CTOUCH_TRANSFORMã¬ãžã¹ã¿ã«ã¯ãŸã æ»ã£ãŠããŸããã
ååãšããŠãã¿ãããæ€åºããããã«REG_TOUCH_TAG_XYããã®ããŒã¿ã䜿çšã§ããŸããããã䟿å©ãªããŒã«ãããã°ã©ããŒã«æäŸãããŸãã
ãããã®ããŒã«ã®äžã§æãç°¡åãªã®ã¯ã¿ã°ïŒTAGïŒã§ãã ã©ãã«ã¯ãã°ã©ãã£ãã¯ãªããžã§ã¯ãã«å²ãåœãŠãããšãã§ãã1ã255ã®çªå·ã§ãã é·æ¹åœ¢ãç¹ãç·ããã¿ã³ãããã¹ããªã©ã ããŒã¯ãããã°ã©ãã£ãã¯ã®é åãã¿ãããããšãREG_TOUCH_TAGã¬ãžã¹ã¿ã§å¯Ÿå¿ããã©ãã«ã®å€ãèšå®ãããŸãã ãããã£ãŠããªããžã§ã¯ãã®ã¿ãããæ€åºããããã«ããã¹ãã³ã³ãããŒã©ãŒã¯å®æçã«REG_TOUCH_TAGã¬ãžã¹ã¿ãããŒãªã³ã°ããåä¿¡ããå€ãç®çã®ãªããžã§ã¯ãã«å²ãåœãŠãããã©ãã«ãšæ¯èŒããå¿ èŠããããŸãã
FT801ã³ã³ãããŒã©ãŒã¯ã¯ãªãã¯ãã©ããã³ã°ããµããŒãããŠããŸããã¿ãããã€ã³ããšæå®ããã座æšãæã€ãã€ã³ããšã®éã®è§åºŠãŸãã¯çŽç·è·é¢ã®èªåèšç®ã§ãã ãã®å Žåãã©ãã«ã®èšå®ã«å ããŠããã®è¿œè·¡ãã©ã¡ãŒã¿ãŒïŒTrackïŒïŒã³ãã³ãïŒãèšå®ããå¿ èŠãããããã€ç ããã§ãã¯ããã«ã¯ãREG_TOUCH_TAGã§ã¯ãªãREG_TRACKERã¬ãžã¹ã¿ããã§ãã¯ããŸãã
ãã ãã次ã®äŸã«ç§»ããŸãããã
2.1ã æ¢è£œã®ãŠã£ãžã§ãããæäœãã
ãŸãããŠã£ãžã§ããïŒã°ã©ãã£ãã¯ã¹ã³ã³ãããŒã©ã«ããŒããŠã§ã¢ã§å®è£ ãããã°ã©ãã£ã«ã«ãªããžã§ã¯ãïŒãæ€èšããŸãã ã¿ããã€ã³ã¿ãŒãã§ã€ã¹ã®3ã€ã®æãåçŽãªãŠã£ãžã§ããã¯ããã¿ã³ãäžé£ã®ãã¿ã³ãããã³ã¹ã©ã€ããŒã§ãã
åçŽãªã³ãã³ãã䜿çšããŠãFT800_2ã©ã€ãã©ãªã«å«ãŸãããŠã£ãžã§ãããæç»ããŸããããã¯ãã·ãªãŒãºã®2çªç®ã®èšäºã§èª¬æããŸãã ã ãã®ãããªåçŽãªé¢æ°ã䜿çšããŠãå³ã«ç€ºãèŠçŽ ãæç»ããŸãã
TFT.FgColor(0xC1004D); TFT.Keys(27, 127, 271, 41, 29, 0, "123"); TFT.Button(26, 33, 120, 36, 27, OPT_FLAT, "Button"); TFT.Slider(244, 45, 161, 17, 0, 17, 100);
èŠçŽ ã衚瀺ãããã ãã§ãªããã¿ããã«å¿çããããã«ã¯ãäœæããããªããžã§ã¯ãã«ã©ãã«ãè¿œå ããã©ãã«ãä¿åããã¬ãžã¹ã¿ãããŒãªã³ã°ããå¿ èŠããããŸãã
ãªããžã§ã¯ãã®èŠçŽ å€æ°ã®ãã¿ã³ïŒããŒïŒã©ãã«ãèªåçã«å²ãåœãŠãããããããã¿ã³ "1"ã "2"ããã³ "3"ã®æŒäžãæ€åºããã«ã¯ãã¬ãžã¹ã¿REG_TOUCH_TAGãããŒãªã³ã°ããã ãã§ååã§ãã
TFT.Keys(27, 127, 271, 41, 29, 0, "123"); char pressedButton = TFT.Rd8(REG_TOUCH_TAG);
ãã¿ã³èŠçŽ ã«ã¯æåã§ã©ãã«ãä»ããå¿ èŠããããŸãã
TFT.DL(TAG(1)); TFT.Button(26, 33, 120, 36, 27, OPT_FLAT, "Button"); char pressedButton = TFT.Rd8(REG_TOUCH_TAG);
ã¹ã©ã€ããŒã䜿çšããå Žåããã©ããã³ã°ã䜿çšãããŸã-ã©ãã«ã®èšå®ã«å ããŠããã©ããã³ã°ãã©ã¡ãŒã¿ãŒãèšå®ããTrackã³ãã³ããå®è¡ããå¿ èŠãããã8ãããREG_TOUCH_TAGã§ã¯ãªã32ãããREG_TRACKERã¬ãžã¹ã¿ãããŒãªã³ã°ããå¿ èŠããããŸãã
char sliderVal = 0; TFT.Track(244, 45, 161, 17, 2); ... while(1) { TFT.DL(TAG(2)); TFT.Slider(244, 45, 161, 17, 0, sliderVal, 255); int pressedSlider = TFT.Rd32(REG_TRACKER); sliderVal = (pressedSlider >> 16) * 255 / 65536; }
äžèšã®ã³ãŒãã䜿çšãããšãã¹ã©ã€ããŒã®äœçœ®ãç»é²ãïŒãã®å Žåã0ãã255ã«å€æŽïŒãã¹ã©ã€ããŒã®çŸåšã®äœçœ®ã«å¿ããŠã¹ã©ã€ããŒãåæç»ã§ããŸãã
2.2ã ã¹ã¯ãªãŒã³ãã£ãªãã¬ãŒã·ã§ã³
å®éãæèŠèŠçŽ ã®æäœã®ããã«ãã°ã©ãã£ãã¯èŠçŽ ã®èª¬æãå«ã衚瀺ãªã¹ããäœæãã察å¿ããã¬ãžã¹ã¿ã調ã¹ãã ãã§ã¯äžååã§ãã
å®éã«ã¯ãTFTã¢ãžã¥ãŒã«ããªã³ã«ããŠåæåãããšãã°ã©ãã£ãã¯ã³ã³ãããŒã©ãŒã®ãã¹ãŠã®ã¬ãžã¹ã¿ãããã©ã«ãå€ã«ãªã»ãããããŸãã å°ãåã«ãæŒããã座æšãèšç®ããããã«ãREG_CTOUCH_TRANSFORMã¬ãžã¹ã¿ã«æ ŒçŽãããŠãããããªãã¯ã¹ã䜿çšããããšè¿°ã¹ãŸããã ãããã£ãŠãåæååŸã®ãããã®ã¬ãžã¹ã¿ãã空ãã§ãããããã«æ£ããå€ãæžã蟌ãããã«ãã¿ããã¹ã¯ãªãŒã³ãèŒæ£ããå¿ èŠããããŸãã
ãã£ãªãã¬ãŒã·ã§ã³ã«ã¯ãã°ã©ãã£ãã¯ã³ããã»ããµãŒCMD_CALIBRATEã®åœä»€ã䜿çšãããŸãã 倧ãŸãã«èšã£ãŠããã®åœä»€ãå°çãããšãFT8xxã°ã©ãã£ãã¯ã¹ã³ã³ãããŒã©ãŒã¯ãã¯ãªãã¯ããå¿ èŠããããã£ã¹ãã¬ã€ã«3ã€ã®ãã€ã³ãã次ã ã«è¡šç€ºããŸãã 3ã€ã®ã¿ããã®åº§æšã«åŸã£ãŠãå¿ èŠãªå€ãREG_CTOUCH_TRANSFORMã¬ãžã¹ã¿ã«å ¥åãããŸãã
FT800_2ã¯ããã£ãªãã¬ãŒã·ã§ã³ã®æšæºæ©èœãæäŸããŸã
DLstart(); DL(CLEAR_COLOR_RGB(64,64,64)); DL(CLEAR(1,1,1)); DL(COLOR_RGB(0xff,0xff,0xff)); Text((DispWidth/2), (DispHeight/2), 27, OPT_CENTER, "Please Tap on the dot"); Calibrate(0); Flush_Co_Buffer(); WaitCmdfifo_empty();
ãã£ãªãã¬ãŒã·ã§ã³æ©èœã¯ãTFTãã£ã¹ãã¬ã€ã®åæåã®æåŸã«åŒã³åºãå¿ èŠããããŸãã 次ã®ããã«ãªããŸãã
ãããªãããžã§ã¯ãã¯developer.mbed.orgã§å ¥æã§ããŸãã
ãã¡ãããããã€ã¹ããªã³ã«ãããã³ã«ãŠãŒã¶ãŒã«ç»é¢ã®ãã£ãªãã¬ãŒã·ã§ã³ã匷å¶ããã®ã¯å¥åŠã§ãã ãããã£ãŠãäžåºŠãã£ãªãã¬ãŒã·ã§ã³ããREG_CTOUCH_TRANSFORM_A ... REG_CTOUCH_TRANSFORM_Fã¬ãžã¹ã¿ã®å 容ãèªã¿åããããŒã¿ãä¿åããTFTã¢ãžã¥ãŒã«ãåæåããåŸãããã°ã©ã ã§REG_CTOUCH_TRANSFORMã¬ãžã¹ã¿ã«å ¥åããããšã¯çã«ããªã£ãŠããŸãã
ãã£ãªãã¬ãŒã·ã§ã³ããŒã¿ã¯äžéšã®EEPROMã«ä¿åã§ããŸããè¯å¿ãéåžžã«äžåšçšãªè¡åãèš±ãå Žåã¯ã次ã®ããã«ããã£ãªãã¬ãŒã·ã§ã³ãã§ããŸãã
void Display::Calibration() { char calibration[25] = {98, 99, 0, 0, 182, 254, 255, 255, 245, 142, 248, 255, 117, 254, 255, 255, 34, 98, 0, 0, 123, 154, 248, 255}; for (int i = 0; i < 24; i++) { (*_TFT).Wr8(REG_TOUCH_TRANSFORM_A + i, calibration[i]); } }
3.ç¬èªã®ãããžã§ã¯ãã§ã¿ããã€ã³ã¿ãŒãã§ã€ã¹ã䜿çšãã
ç§ã®æåŸã®ã¢ããªã±ãŒã·ã§ã³ã¯ã枩床ãšçžå¯Ÿæ¹¿åºŠã«é¢ããçŸåšã®ããŒã¿ãšããã€ãã®ãµãã»ã¯ã·ã§ã³ã衚瀺ããã¡ã€ã³ã¡ãã¥ãŒã§ãã
次ã®èšäºã§ã®ã¿ç»ååºåãšãã·ã¢åã®åé¡ã«å¯ŸåŠãããããä»æ¥ã¯åå®æãããžã§ã¯ããåæããŸãã
ã»ã¯ã·ã§ã³éã移åããã«ã¯ã2ã€ã®åæããããŸãã 1ã€ç®ã¯ãã°ã©ãã£ãã¯ãªããžã§ã¯ãã«å²ãåœãŠããããã¹ãŠã®ã©ãã«ã§ãã
typedef enum { NONE_PRESS, CURR_TEMP_PRESS, CURR_HUM_PRESS, MENU_PRESS, } pressValues;
2çªç®ã¯ãåãæ¿ããç»é¢ã®ãªã¹ãã§ãã
typedef enum { MENU_SCREEN, CURR_HUM_SCREEN, CURR_TEMP_SCREEN, } screenValues;
ã¢ããªã±ãŒã·ã§ã³ã®ããžãã¯ã¯æ¬¡ã®ãšããã§ãã
disp.activeScreen = MENU_SCREEN; disp.pressedButton = NONE_PRESS; // change active screen depending on pressed area while(1) { dataUpdate(); disp.pressedButton = disp.GetTouch(); // Main menu screen if (disp.activeScreen == MENU_SCREEN) { disp.MainMenu(SENSOR.humidity, SENSOR.temperature); if (disp.pressedButton) { wait_ms(150); if (disp.pressedButton == CURR_TEMP_PRESS) { disp.activeScreen = CURR_TEMP_SCREEN; } else if (disp.pressedButton == CURR_HUM_PRESS) { disp.activeScreen = CURR_HUM_SCREEN; } disp.pressedButton = NONE_PRESS; } // Any other screen } else { // You can back to main menu from any screen if (disp.pressedButton == MENU_PRESS) { disp.pressedButton = NONE_PRESS; disp.activeScreen = MENU_SCREEN; } else { // Screen with current temperature / humidity if (disp.activeScreen == CURR_TEMP_SCREEN) { disp.CurrentTemperature(SENSOR.temperature); } else if (disp.activeScreen == CURR_HUM_SCREEN) { disp.CurrentHumidity(SENSOR.humidity); } } } }
3ã€ã®ç»é¢ãã¹ãŠãæç»ããã«ã¯ãåçŽãªã°ã©ãã£ãã¯ããªããã£ãïŒLINESãPOINTSãEDGE_STRIP_Bãããã³RECTSïŒãšãããã¹ããšæ°åã衚瀺ããããã®ãŠã£ãžã§ããã®ã¿ã䜿çšãããŸãã ã æããã®ããããmbed [ããŒã2]ã«æãããæ¹æ³ããšããèšäºãèªãã åŸã¯ãã¡ãã¥ãŒé ç®ãšã°ã©ãã®æç»ã«ã€ããŠè³ªåããªãã¯ããªã®ã§ãã¿ããå ¥åèŠçŽ ã®å®è£ ã®ã¿ã«çŠç¹ãåœãŠãŸãã
ã¡ã€ã³ã¡ãã¥ãŒã®äžéšã®ãã¿ã³ã«ã¯ããŸããŸãªãµã€ãºã®ç»åãšç·ã
é·æ¹åœ¢ãªã©ã®ãéåžžã®ãã°ã©ãã£ãã¯ãªããžã§ã¯ãã®ã©ãã«ïŒTAGïŒã¯ããŠã£ãžã§ããã®äœ¿çšãšåãæ¹æ³ã§èšå®ãããŸãã TAGã³ãã³ãïŒCURR_HUM_PRESSïŒã®åŒã³åºãåŸã«èšè¿°ããããã¹ãŠã®ã°ã©ãã£ãã¯ãªããžã§ã¯ãã«ã¯ãã©ãã«CURR_HUM_PRESSãå²ãåœãŠãããŸãã ããŒã¯ããããªããžã§ã¯ãã®ãªã¹ããçµäºããã«ã¯ãTAGïŒïŒãæ°ããåŒæ°ã§åŒã³åºãããTAG_MASKïŒ0ïŒã³ãã³ãã䜿çšããŠã©ãã«ã®å²ãåœãŠãçŠæ¢ããŸãã TAG_MASKïŒ0ïŒã䜿çšããå Žåã次ã®TAGïŒïŒã®åŒã³åºãã®åã«ãã¿ã°ä»ãïŒTAG_MASKïŒ1ïŒïŒãæå¹ã«ããããšãå¿ããªãã§ãã ããã
ãŸããã¯ãªãã¯ãèŠèŠåããããšãæ€èšãã䟡å€ããããŸãã ç§ã®å Žåãããã¯ããã®ããã«è¡ãããŸãïŒ
aïŒåã®ãã¬ãŒã ãTFTãã£ã¹ãã¬ã€ã«è¡šç€ºãããåŸããã¿ã³ã®ã¿ãããåºå®ããããšãæ°ãããã¬ãŒã ã§ãã¿ã³ã®è²ãæ¿ãéããéã«å€ãããŸãïŒä»¥äžã®ã³ãŒããåç §ïŒã
bïŒãã¬ãŒã ãéããã¿ã³ã§è¡šç€ºããåŸã150ããªç§ã®é 延ãå®è¡ãããŸãïŒäžèšã®ã³ãŒããåç §ïŒã
void Display::MainMenu(float humidity, float temperature) { ... (*_TFT).DL(TAG_MASK(1)); (*_TFT).DL(TAG(CURR_HUM_PRESS)); (*_TFT).DL(COLOR_RGB(9, 0, 63)); // , if (pressedButton == CURR_HUM_PRESS) { (*_TFT).DL(COLOR_RGB(75, 70, 108)); } (*_TFT).DL(BEGIN(RECTS)); (*_TFT).DL(VERTEX2II(12, 62, 0, 0)); (*_TFT).DL(VERTEX2II(12 + 400, 62 + 93, 0, 0)); (*_TFT).DL(COLOR_RGB(255, 255, 255)); (*_TFT).Text(12 + 10, 62 + 5, 30, 0, "Current humidity (rH)"); // (32 -> "32%") CreateStringTempHum(humidityStr, humidity, 0); (*_TFT).Text(12 + 10, 62 + 45, 31, 0, humidityStr); (*_TFT).DL(TAG_MASK(0)); ... }
ã¡ã€ã³ã¡ãã¥ãŒã®ãã¹ãŠã®ãã¿ã³ã¯åãæ¹æ³ã§åœ¢æãããŸãã [çŸåšã®æž©åºŠ]ãã¿ã³ãã¯ãªãã¯ãããšã枩床å€åã®ã°ã©ãã衚瀺ãããç»é¢ã«ç§»åããçžå¯Ÿæ¹¿åºŠã®å€åã®ã°ã©ãã衚瀺ãããç»é¢ã®[çŸåšã®æ¹¿åºŠ]ãã¯ãªãã¯ããŸãã
ã°ã©ãã®ããç»é¢ãããã¡ã€ã³ã¡ãã¥ãŒã«æ»ããªã³ã¯ãã¯ãªãã¯ããŠãã¡ã€ã³ã¡ãã¥ãŒã«æ»ãããšãã§ããŸãã ãã®ãããªãªã³ã¯ãäœæããã«ã¯ãåãããŒã«ã䜿çšãããŸã-TAGã©ãã«ïŒMENU_PRESSïŒããã®åŸã«ã°ã©ãã£ãã¯ãªããžã§ã¯ããèšè¿°ãããŸã-ããã¹ãè¡ãšè¡ïŒäžç·ïŒã
(*_TFT).DL(TAG_MASK(1)); (*_TFT).DL(TAG(MENU_PRESS)); (*_TFT).DL(COLOR_RGB(0, 0, 0)); (*_TFT).Text(14, 240, 22, 0, "Back to main menu"); (*_TFT).DL(BEGIN(LINES)); (*_TFT).DL(LINE_WIDTH(8)); (*_TFT).DL(VERTEX2F(15 * 16, 260 * 16)); (*_TFT).DL(VERTEX2F(155 * 16, 260 * 16)); (*_TFT).DL(TAG_MASK(0));
次ã®ããã«ãªããŸãã
ãããžã§ã¯ãã®ãœãŒã¹ã³ãŒãã¯developer.mbed.orgã§å ¥æã§ããŸãã
ãã®ãããžã§ã¯ããããã³ãã³ã¯ã®ãŠã£ãžã§ããã䜿çšãããã¢ãããžã§ã¯ããããã³ä»¥åã®èšäºã§èª¬æããããã°ã©ã ã¯ãSilicon Labsã®SLSTK3400AããŒããAtmelã®ATSAMD21-XPROãWiznetã®WIZwiki-W7500Pã§æ£åžžã«èµ·åãããŸãã 䜿çšããGPIOã®ååãå€æŽããã³ã³ãã€ã«ããåã«ã¿ãŒã²ããããŒãã亀æããã ãã§ãã ãªãmbedã奜ãã§ããïŒ
ãããã«
çµè«ãšããŠãç§ã¯äŒçµ±çã«èªè ã®æ³šæã«æè¬ããHabréã«ã€ããŠæžããŠãã補åã®äœ¿çšã«é¢ãã質åã¯ãç§ã®ãããã£ãŒã«ã§æå®ãããã¡ãŒã«ã¢ãã¬ã¹ã«ãéä¿¡ã§ããããšãæãåºãããŸãã