====== SAMPLE 7: Contast 조정 ====== 본 프로그램을 이용하여, Contrast 를 조정할 수 있고, 그 값을 EEPROM 의 &HFFF 번지에 기록합니다. #include "CT18XX" Dim CT18_cont_value As Byte CT18_cont_value = Eeread(&hfff,1) If CT18_cont_value = &hff Then CT18_cont_value = 150 Endif Ct18contrast CT18_cont_value Box 10,20,310,100 Box 10,140,310,230 Font 5,1 Glocate 120,50 Gprint "Contrast +" Glocate 120,175 Gprint "Contrast -" Ct18beep 30 Font 2,0 On Pad Gosub TouchOccur ' '********************* 메인 do 루프 ************************ ' Do Locate 0,0 Print "20",Hp(Rtcread(6),2,1),"-",Hp(Rtcread(5),2,1),"-",Hp(Rtcread(4),2,1), _ " ", Hp(Rtcread(2),2,0),":",Hp(Rtcread(1),2,1),":",Hp(Rtcread(0),2,1) Locate 24,0 Print "Contrast : ",Dp(CT18_cont_value,3,0) Wait 1000 Loop TouchOccur: _TouchPosx = Sys(10) _TouchPosy = Sys(11) If _TouchPosy > 120 Then CT18_cont_value = CT18_cont_value - 1 Ct18contrast CT18_cont_value Eewrite &hfff,CT18_cont_value,1 Else CT18_cont_value = CT18_cont_value + 1 Ct18contrast CT18_cont_value Eewrite &hfff,CT18_cont_value,1 Endif Ct18beep 30 Return End 화면 맨위에는 RTC 로부터 읽은 현재시각을 표시합니다. {{ :ct1820:sample_7_contast_조정:sample7.png?nolink |}}