Projekte
BirgerT
nibo2_fork#01
test_gfx_draw.h
Projekte
Forum
Doku
Öffentliche Projekte
Startseite
Beispielprogramme
Projekte von anderen
Welcome
Username
Passwort
Eingeloggt bleiben
Zugangsdaten vergessen?
Registrieren
Projektverwaltung
⇨ Please choose! ⇦
——————————————————
✎ Create new project...
★ Browse existing projects...
——————————————————
⚬ MotorTest#1
⚬ C Tutorial 8#1
⚬ NIBO2 C Project#1
⚙ C Tutorial 15#1
⚬ 2010_11_18_el_test001#1
nibo2_fork#01
BSD_license.h
bt_lib_debugutil.c
bt_lib_debugutil.h
bt_lib_glcd.c
bt_lib_glcd.h
bt_lib_grafix.c
bt_lib_grafix.h
bt_lib_terminal.c
bt_lib_terminal.h
bt_lib_uart.c
bt_lib_uart.h
bt_lib_utils.h
lumpylumpy.h
main.c
nibo2_audio.c
nibo2_audio.h
nibo2_copro.c
nibo2_copro.h
nibo2_copro_cmd.h
nibo2_font.h
nibo2_global.h
nibo2_main_menu.h
nibo2_pwm_leds.c
nibo2_pwm_leds.h
nibo2_register.c
nibo2_register.h
nibo2_sensors.c
nibo2_sensors.h
test_debugutil.h
test_gfx_draw.h
xmas1.h
Project details
Compiler settings
Nachrichten
Sie sind nicht eingeloggt.
Neuigkeiten
★
NiboRoboLib 3.6
2017-01-17: Neue Version 3.6
★
NiboRoboLib 3.4.1
2016-04-16: Neue Version 3.4.1
★
Coding Tutorial
2015-11-22: Jetzt auch für den NIBO burger!
Site-Statistic
7426 private projects
385 public projects
16180353 lines compiled
58212 builds
NIBO
@
nibo2_fork_01/test_gfx_draw.h [read only]
////////////////////////////////////////////////////////////////////////// // // DRAW TEST Testroutinen für die GFX Bibliothek // // (c) Birger Töpelmann toepelmann(A)web.de Version 141008a // // // // // ////////////////////////////////////////////////////////////////////////// // // BSD License see "BSD_license.h" // #include "BSD_license.h" // //#ifndef _BTLIB__H_ //#define _BTLIB__H_ //#include "bt_lib_utils.h" // Sammlung von Makros und Typedefs // Funktionen arbeiten mit Grafik Buffer // // void gfx_init(); // void gfx_fill(uint8_t data); // // void gfx_gotoXY(uint8_t x, uint8_t y); // void gfx_moveXY(uint8_t x, uint8_t y); // void gfx_pixel(uint8_t val); // void gfx_setpixelXY(uint8_t x, uint8_t y, uint8_t val); // // void gfx_print_bigchar(char chr, uint8_t h, uint8_t w); // void gfx_print_char(char chr); // void gfx_print_str(char * str); // void gfx_print_str_P(PGM_P str); // void gfx_curpos(uint8_t z, uint8_t s); // // PGM_P gfx_ansi_strP(PGM_P str); // // int16_t gfx_printf(const char* str, ...); // int16_t gfx_printfP(PGM_P str, ...); // // uint8_t gfx_drawmode(uint8_t dm); // void gfx_box(uint8_t width, uint8_t height, uint8_t data); // void gfx_line(uint8_t xa, uint8_t ya, uint8_t xe, uint8_t ye, uint8_t mask); // void gfx_circle(uint8_t x, uint8_t y, uint8_t r, uint8_t val, uint8_t mask); // void gfx_circle2(uint8_t x, uint8_t y, uint8_t r, uint8_t val, uint8_t mask); // // // * ****************************************** GLCD Drawmodi // #define GFX_DM_SET (uint8_t)0x00 // #define GFX_DM_OR (uint8_t)0x01 // #define GFX_DM_XOR (uint8_t)0x02 // #define GFX_DM_AND (uint8_t)0x03 // #define GFX_DM_INV (uint8_t)0x04 // #define GFX_DM_IOR (uint8_t)(GFX_DM_OR | GFX_DM_INV) // #define GFX_DM_IXOR (uint8_t)(GFX_DM_XOR | GFX_DM_INV) // #define GFX_DM_IAND (uint8_t)(GFX_DM_AND | GFX_DM_INV) // #define GFX_DM_TERM (uint8_t)0x08 // #define GFX_DM_LINE (uint8_t)0x10 #define max_x 127 #define max_y 63 typedef struct{ uint8_t x; uint8_t y; } punkt_t; #define dz 16 // Rastergröße const uint8_t drawing_1[] PROGMEM = { // 15,max_y-10, // Startpunkt links unten // x, y // relativ zum letzten Punkt 0, -dz, // rauf dz, 0, // rechts 0, dz, // runter -dz, 0, // links dz, -dz, // rechts, rauf -dz/2, -dz/2, // halb links, halb rauf -dz/2, dz/2, // halb links, halbrunter dz, dz, // rechts runter }; void gfx_draw_test() { static uint8_t start_x, start_y, ende_x, ende_y, idx_x, idx_y; gfx_init(); // Buffer löschen pwm_lcd(60); // gfx_line(20,20,20,40,1); // gfx_line(30,10,50,10,1); // ----------------------------------------------------------- idx_x = 0; ende_x = 15; //pgm_read_byte(&drawing_1[idx_x++]); ende_y = max_y-10; //pgm_read_byte(&drawing_1[idx_x++]); do { start_x = ende_x; start_y = ende_y; ende_x += pgm_read_byte(&drawing_1[idx_x++]); ende_y += pgm_read_byte(&drawing_1[idx_x++]); gfx_line(start_x,start_y,ende_x,ende_y,1); } while ( idx_x < sizeof(drawing_1)); // ----------------------------------------------------------- idx_x = 0; ende_x = 15 + dz/2; ende_y = max_y - 10 - dz/2 - dz/4; idx_y = dz; gfx_circle(ende_x,ende_y,idx_y,1,0xff); idx_y += 3; gfx_circle(ende_x,ende_y,idx_y,1,0xff); // ----------------------------------------------------------- gfx_gotoXY(15,4); gfx_print_bigchar('B',1,3); gfx_print_bigchar('I',2,3); gfx_print_bigchar('G',3,3); // gfx_gotoXY(50,36); gfx_print_bigchar('C',3,2); gfx_print_bigchar('H',2,2); gfx_print_bigchar('A',1,2); gfx_print_bigchar('R',2,1); // gfx_print_bigchar(' ',1,2); gfx_gotoXY(55,36); gfx_print_bigchar('T',3,1); gfx_print_bigchar('E',2,1); gfx_print_bigchar('S',2,1); gfx_print_bigchar('T',1,1); // ----------------------------------------------------------- idx_x = 0; ende_x = 95; //pgm_read_byte(&drawing_1[idx_x++]); ende_y = max_y-10; //pgm_read_byte(&drawing_1[idx_x++]); do { start_x = ende_x; start_y = ende_y; ende_x += pgm_read_byte(&drawing_1[idx_x++]); ende_y += pgm_read_byte(&drawing_1[idx_x++]); gfx_line(start_x,start_y,ende_x,ende_y,1); } while ( idx_x < sizeof(drawing_1)); // ----------------------------------------------------------- idx_x = 0; ende_x = 95 + dz/2; ende_y = max_y - 10 - dz/2 - dz/4; idx_y = dz; gfx_circle(ende_x,ende_y,idx_y,1,0xff); idx_y += 3; gfx_circle(ende_x,ende_y,idx_y,1,0xff); // ----------------------------------------------------------- } // gfx_draw_test() //#endif //_BTLIB__H_
Compiler results:
Werbung
Online
brittney747920000
juanmcinnis5050
romanrendall465571132
warrenhinder6456