WQV43-Touch및 WV70-Touch 제품 소개 사진에 사용된 예제 Source code 입니다.
"현재온도"등 화면에 표시된것과 관련해 실제 동작은 하지 않고 단순히 사진에 나온대로 화면만 그려주는 예제입니다.
필요한 기능 구현에 참조하시기 바랍니다.
1. 전원을 켭니다.
2. 전원이 켜지면서 RS-232(UART0) 포트로는 "*** LC-128A for WQV43-Touch *** "라는 message가 115200 Bps로 송신됩니다.
3. 아래 화면이 표시됩니다.
기타기능
- 전원 스위치를 1초간 누르고 있으면 Buzzer로 소리가 나옵니다.
- 전원 스위치를 다시 약 2초간 누르고 있으면 LCD Backlight가 꺼집니다.
- 최초 전원이 켜진후 2초 이내에 전원 스위치를 짧게 6번 누르면 터치 스크린 Calibration 모드로 진입합니다.
- 터치 스크린을 누르면 화면 하단에 눌려진 X, Y 좌표를 표시합니다.
(화면 우측의 버튼을 눌러도 아무런 동작도 하지 않습니다.)
- 터치 스크린 Y축 상단을 누르면 LCD Backlight가 어두워지고, Y축 하단을 누르면 LCD Backlight가 밝아집니다.
- RS-232 포트로 CLS:0xffff (0xffff 는 16byts RGB 5-6-5 color) 등 명령을 보내면 전체 화면이 지정한 색으로 칠해진다.
WQV43-Touch Demo 소스코드 : WQV43-Demo(20120320A).zip
WV70-Touch Demo 소스코드 : WV70-Demo(20120320A).zip
!!! 주의사항.
데모 소스에는 한글과 모양 라이브러리가 사용되었으며 해당 라이브러리가 필요 없으신분들은
libez_hangul.a와 libez_shapes.a 라이브러리를 Project-Configuration Options 에서 제거하고,
define.h 파일에서 아래와 같이 두 문장을 지워버리면 약 25Kbyte 정도의 사용자 memory를 더 확보 할 수 있습니다.
// #define USE_HANGUL // #define USE_SHAPES
|
< WQV43-Touch 화면표시 Demo 소스 상세사항 >.
위 화면은 한글을 구현해 주는 ez_hangul 라이브러리와 각종 버튼및 Frame 모양을 구현해주는 ez_Shape 라이브러리를 사용하여 Program 되었습니다.
해당 라이브러리는 define.h 파일에 아래와 같이 정의하였으며,
< define.h >
#define USE_HANGUL --> 사용함. #define USE_SHAPES --> 사용함. //#define USE_SAMPLE_BMP --> 사용하지 않음. |
데모 화면은 menu_processing.c 파일안에 있는 void draw_menu0(void) 에서 아래와 같이 간편하게 구현하였습니다.
WQV43-Touch "menu_processing.c" 파일.
void draw_menu0(void) { //이전화면 지우기 clear_box(1, 0, 0, 480, 272, color_DCYAN); // (1=landscape, x=0, y=0, width=480, height=272, color) --- faster than draw_box()
//버튼 바당에 frame1 그리기. draw_frame1(1, 2, 324, 5, 155, 262, color_SSILVER, color_ABLUE, color_DCYAN, color_MGRAY);
// (orientation, type, x, y, width, height, fg_color, fi_color, bg_color, sh_color)
//R2 버튼 그리기. draw_R2button(1, 1, 335, 22, 139, 35, color_SSILVER, color_OBLUE, color_ABLUE, color_MGRAY);
// (orientation, shadow, x, y, width, height, fg_color, fi_color, bg_color, sh_color) draw_R2button(1, 1, 335, 22+48, 139, 35, color_SSILVER, color_DRED, color_ABLUE, color_MGRAY);
// (orientation, shadow, x, y, width, height, fg_color, fi_color, bg_color, sh_color) draw_R2button(1, 1, 335, 22+96, 139, 35, color_SSILVER, color_OBLUE, color_ABLUE, color_MGRAY);
// (orientation, shadow, x, y, width, height, fg_color, fi_color, bg_color, sh_color) draw_R2button(1, 1, 335, 22+144, 139, 35, color_SSILVER, color_OBLUE, color_ABLUE, color_MGRAY);
// (orientation, shadow, x, y, width, height, fg_color, fi_color, bg_color, sh_color) draw_R2button(1, 1, 335, 22+192, 139, 35, color_SSILVER, color_OBLUE, color_ABLUE, color_MGRAY);
// (orientation, shadow, x, y, width, height, fg_color, fi_color, bg_color, sh_color)
//R2 버튼위에 한글쓰기. lcd_puts_HanEng(1, 1, "LINE 함수", 335+30, 22+26, 0, color_WHITE, color_OBLUE);
// (orientation, mag, "Strings", x, y, normal=0/invert=1, fg_color, bg_color) lcd_puts_HanEng(1, 1, "Color 조정", 335+30-5, 22+48+26, 0, color_WHITE, color_DRED);
// (orientation, mag, "Strings", x, y, normal=0/invert=1, fg_color, bg_color) lcd_puts_HanEng(1, 1, "온 도 설 정", 335+30-7, 22+96+26, 0, color_WHITE, color_OBLUE);
// (orientation, mag, "Strings", x, y, normal=0/invert=1, fg_color, bg_color) lcd_puts_HanEng(1, 1, "Touch 시험", 335+30-3, 22+144+26, 0, color_WHITE, color_OBLUE);
// (orientation, mag, "Strings", x, y, normal=0/invert=1, fg_color, bg_color) lcd_puts_HanEng(1, 1, "Touch CAL.", 335+30-4, 22+192+26, 0, color_WHITE, color_OBLUE);
// (orientation, mag, "Strings", x, y, normal=0/invert=1, fg_color, bg_color)
//중앙 좌측에 Frame1 그리기. draw_frame1(1, 0, 5, 5, 315, 262, color_SSILVER, color_ABLUE, color_DCYAN, color_MGRAY);
// (orientation, type, x, y, width, height, fg_color, fi_color, bg_color, sh_color)
//중앙 Frame에 글씨쓰기 draw_frame1(1, 0, 30, 19, 265, 60, color_SSILVER, color_OBLUE, color_DCYAN, color_MGRAY);
// (orientation, type, x, y, width, height, fg_color, fi_color, bg_color, sh_color) lcd_puts_HanEng(1, 3, "현재온도", 90, 66, 0, color_SSILVER, color_OBLUE);
// (orientation, mag, "Strings", x, y, normal=0/invert=1, fg_color, bg_color) lcd_puts_24x30(1, "25", 90+20, 66+54, color_DRED, color_ABLUE);
// (orientation, number string to display, x, y, foreground color, background color) lcd_puts_HanEng(1, 3, "도", 90+20+70, 66+54, 0, color_SSILVER, color_ABLUE);
// (orientation, mag, "Strings", x, y, normal=0/invert=1, fg_color, bg_color)
//구획선 그리기 draw_box(1, 35, 135, 255, 2, color_YELLOW);
// (1=landscape, x, y, width, height, color)
//Color Bar 그리기. lcd_puts(1, 1, font_ascii_7x11, "YELLOW", 24, 180, 0, color_DBLUE, color_ABLUE);
// (orientation, mag, "Strings", x, y, normal=0/invert=1, fg_color, bg_color) lcd_puts(1, 1, font_ascii_7x11, "BLUE", 24, 180+20, 0, color_DBLUE, color_ABLUE);
// (orientation, mag, "Strings", x, y, normal=0/invert=1, fg_color, bg_color) lcd_puts(1, 1, font_ascii_7x11, "RED", 24, 180+40, 0, color_DBLUE, color_ABLUE);
// (orientation, mag, "Strings", x, y, normal=0/invert=1, fg_color, bg_color) lcd_puts(1, 1, font_ascii_7x11, "GREEN", 24, 180+60, 0, color_DBLUE, color_ABLUE);
// (orientation, mag, "Strings", x, y, normal=0/invert=1, fg_color, bg_color)
draw_box(1, 80, 180-16, 5, 80, color_WHITE); // (1=landscape, x, y, width, height, color)
draw_box(1, 85, 180-12, 215, 12, color_YELLOW); // (1=landscape, x, y, width, height, color) draw_box(1, 85, 180-12+20, 80, 12, color_BLUE); // (1=landscape, x, y, width, height, color) draw_box(1, 85, 180-12+40, 150, 12, color_RED); // (1=landscape, x, y, width, height, color) draw_box(1, 85, 180-12+60, 180, 12, color_GREEN); // (1=landscape, x, y, width, height, color)
} |
< WV70-Touch 화면표시 Demo Source 상세사항 >.
위 화면은 한글을 구현해 주는 ez_hangul 라이브러리와 각종 버튼및 Frame 모양을 구현해주는 ez_Shape 라이브러리를 사용하여 Program 되었습니다.
해당 라이브러리는 define.h 파일에 아래와 같이 정의하였으며,
< define.h >
#define USE_HANGUL --> 사용함. #define USE_SHAPES --> 사용함. //#define USE_SAMPLE_BMP --> 사용하지 않음. |
데모 화면은 menu_processing.c 파일안에 있는 void draw_menu0(void) 에서 아래와 같이 간편하게 구현하였습니다.
WV70-Touch "menu_processing.c" 파일.
void draw_menu0(void) { //이전화면 지우기 clear_box(1, 0, 0, 800, 480, color_DCYAN); // (1=landscape, x=0, y=0, width=800, height=480, color) --- faster than draw_box()
//상-하-중앙 Frame 꾸미기 draw_frame2(1, 1, 20, 0, 760, 50, color_SSILVER, color_ABLUE, color_DCYAN, color_MGRAY);
// (orientation, type, x, y, width, height, fg_color, fi_color, bg_color, sh_color) draw_frame2(1, 3, 20, 479-50, 760, 50, color_SSILVER, color_ABLUE, color_DCYAN, color_MGRAY);
// (orientation, type, x, y, width, height, fg_color, fi_color, bg_color, sh_color) draw_frame2(1, 0, 20, 60, 760, 360, color_SSILVER, color_ABLUE, color_DCYAN, color_MGRAY);
// (orientation, type, x, y, width, height, fg_color, fi_color, bg_color, sh_color)
//헤더에 글씨쓰기 lcd_puts_HanEng(1, 2, "WV70-Touch Demo 화면", 40, 32, 0, color_WHITE, color_ABLUE);
// (orientation, mag, "Strings", x, y, normal=0/invert=1, fg_color, bg_color)
//Footer에 글씨쓰기 lcd_puts_HanEng(1, 1, "powered by www.ezcircuits.net", 500, 479-15, 0, color_BLUE, color_ABLUE);
// (orientation, mag, "Strings", x, y, normal=0/invert=1, fg_color, bg_color)
//화면 우측에 R2 버튼 그리기. draw_R2button(1, 1, 600, 100, 139, 35, color_SSILVER, color_OBLUE, color_DCYAN, color_MGRAY);
// (orientation, shadow, x, y, width, height, fg_color, fi_color, bg_color, sh_color) draw_R2button(1, 1, 600, 100+50, 139, 35, color_SSILVER, color_DRED, color_DCYAN, color_MGRAY);
// (orientation, shadow, x, y, width, height, fg_color, fi_color, bg_color, sh_color) draw_R2button(1, 1, 600, 100+100, 139, 35, color_SSILVER, color_OBLUE, color_DCYAN, color_MGRAY);
// (orientation, shadow, x, y, width, height, fg_color, fi_color, bg_color, sh_color) draw_R2button(1, 1, 600, 100+150, 139, 35, color_SSILVER, color_OBLUE, color_DCYAN, color_MGRAY);
// (orientation, shadow, x, y, width, height, fg_color, fi_color, bg_color, sh_color) draw_R2button(1, 1, 600, 100+200, 139, 35, color_SSILVER, color_OBLUE, color_DCYAN, color_MGRAY);
// (orientation, shadow, x, y, width, height, fg_color, fi_color, bg_color, sh_color)
//버튼에 글씨쓰기 lcd_puts_HanEng(1, 1, "LINE 함수", 600+30, 100+26, 0, color_WHITE, color_OBLUE);
// (orientation, mag, "Strings", x, y, normal=0/invert=1, fg_color, bg_color) lcd_puts_HanEng(1, 1, "Color 샘플", 600+30-5, 100+50+26, 0, color_WHITE, color_DRED);
// (orientation, mag, "Strings", x, y, normal=0/invert=1, fg_color, bg_color) lcd_puts_HanEng(1, 1, "Shape 샘플", 600+30-7, 100+100+26, 0, color_WHITE, color_OBLUE);
// (orientation, mag, "Strings", x, y, normal=0/invert=1, fg_color, bg_color) lcd_puts_HanEng(1, 1, "Touch 그림판", 600+30-12, 100+150+26, 0, color_WHITE, color_OBLUE);
// (orientation, mag, "Strings", x, y, normal=0/invert=1, fg_color, bg_color) lcd_puts_HanEng(1, 1, "Touch CAL.", 600+30-4, 100+200+26, 0, color_WHITE, color_OBLUE);
// (orientation, mag, "Strings", x, y, normal=0/invert=1, fg_color, bg_color)
//중앙 Frame 안쪽에 구획 나누기용 Frmae 그리기. draw_frame1(1, 0, 50, 90, 500, 280, color_SSILVER, color_GRAY, color_ABLUE, color_MGRAY);
// (orientation, type, x, y, width, height, fg_color, fi_color, bg_color, sh_color)
//중앙 Frame에 글씨쓰기 lcd_puts_HanEng(1, 3, "현재온도 :", 120, 160, 0, color_SSILVER, color_GRAY);
// (orientation, mag, "Strings", x, y, normal=0/invert=1, fg_color, bg_color) lcd_puts_24x30(1, "25", 360, 160, color_DRED, color_GRAY);
// (orientation, number string to display, x, y, foreground color, background color) lcd_puts_HanEng(1, 3, "도", 440, 160, 0, color_SSILVER, color_GRAY);
// (orientation, mag, "Strings", x, y, normal=0/invert=1, fg_color, bg_color)
//Color Bar 그리기. lcd_puts_HanEng(1, 1, "YELLOW", 80, 240, 0, color_NBLUE, color_GRAY);
// (orientation, mag, "Strings", x, y, normal=0/invert=1, fg_color, bg_color) lcd_puts_HanEng(1, 1, "BLUE", 80, 240+30, 0, color_NBLUE, color_GRAY);
// (orientation, mag, "Strings", x, y, normal=0/invert=1, fg_color, bg_color) lcd_puts_HanEng(1, 1, "RED", 80, 240+60, 0, color_NBLUE, color_GRAY);
// (orientation, mag, "Strings", x, y, normal=0/invert=1, fg_color, bg_color) lcd_puts_HanEng(1, 1, "GREEN", 80, 240+90, 0, color_NBLUE, color_GRAY);
// (orientation, mag, "Strings", x, y, normal=0/invert=1, fg_color, bg_color)
draw_box(1, 155, 240-25, 5, 120, color_WHITE); // (1=landscape, x, y, width, height, color)
draw_box(1, 160, 240-15, 250, 12, color_YELLOW); // (1=landscape, x, y, width, height, color) draw_box(1, 160, 240-15+30, 150, 12, color_BLUE); // (1=landscape, x, y, width, height, color) draw_box(1, 160, 240-15+60, 200, 12, color_RED); // (1=landscape, x, y, width, height, color) draw_box(1, 160, 240-15+90, 320, 12, color_GREEN); // (1=landscape, x, y, width, height, color) } |
-------------------------------------------------------------------------------------------
|
회원에게만 댓글 작성 권한이 있습니다.