From 9400caa634c2321c953ee52bc7e0923938f4961e Mon Sep 17 00:00:00 2001 From: Thammi Date: Thu, 5 Sep 2013 22:13:51 +0200 Subject: [PATCH 1/2] Add german documentation and matrix code --- firmware/doc/befehle.odt | Bin 0 -> 20080 bytes firmware/include/pentabug/matrix.h | 14 ++++++ firmware/lib/matrix.c | 70 +++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+) create mode 100644 firmware/doc/befehle.odt create mode 100644 firmware/include/pentabug/matrix.h create mode 100644 firmware/lib/matrix.c diff --git a/firmware/doc/befehle.odt b/firmware/doc/befehle.odt new file mode 100644 index 0000000000000000000000000000000000000000..3ebda3ba1b6dbc4632c90324dc3b3f83cc6ae7ef GIT binary patch literal 20080 zcmd43b980j(kPmaosMnWwr#6p+v-@IjytyPbdnBx$F^<14f^rqEu0$#0zy3? zEhenynR%84rH5t#9N1WrU<3sP{k|wJRQFlD652TOhb3DwnYA;w$t}u_BA@EH^UzUQ zZ*S@hT0#F8<9u%A0%cn&2_a!2Zv!4#-Qn)0cix+G#Gd-7=24RF=T|bO@zL@2i$~}S zhinR^iaC&AE3mE^0+3?a;4`ou$R;Fs+(iKhEP&-C`vUF^u zOJ48+m-o#CeM6cqzSj2oKf^SvX~pN)0DAiIhs5S^V=Y`_i^PXt7pC& zt>v7=`i-}r#%sQ}yleulS!sZX^{j@SSi#J_0)B9^RFz3fniOINZ~D|Ujc(U&FkX$+ z>^=+KRXz0E6=P6pd;R9`W;b>N+_cYYrMC$3%k6a@IVdg0jtw)JbrC*Wl0r?cvy|_@ z-Wz85xsL|ZHNVU7OKSHYTn~_cSGU2uZB=p!K6sKH6;k~xQij|=h)ZOIBG+(lRIwL;@Ra&61E8SWb*08_PX$h4)X2A z^H`g8QX&V4mCX(R7;cyAD`wZiz11^h$;(6My!!lUv|w&1ez@z+9rXG^WXP>xBs~ICWK9<1y36_K{EqD#@mkziWf&?XhKlKkCOa#1#CT~P*Ke`_QEVO8j z6ZpW)^Srz;B6r3GLR{+Hsd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6Zg@_%GncF#n6` zVEl*KKdApe9sdK9`QMn1M$SeS&PI-w{~)um|GUP+!P)d5;Quv4Q!}V&at2UCa!G0t zT*|;4=9IkrJl*n)%#zgNg2ZH?o6wb7ni(nS+u1ddeeX>q~8`-FiEh-nP1RW1F`8EZL7)%}eKN z?JCdHvW%bBs%y@ZbAIz8jfz>HZT$Br9lUB$=)rSrOCJZPT(48+*C#bnmggREriBNV zyk0P&^1Fg<_g$-%3pQ~jZVTGmzD;3bqeCyJ J@W|>`n-ban6eGardxbW?x;|Y5& zH!reD_@Lc){>Hryo@Gzt9_-!lE~fc@&D4ylcgapvId->^^;4BilDQB%-~T+pn3+-IWZsrF&0+%Lc}1X6p%tU7LmgFWD6ywn>gGDnif2J3u787tT=#(9FZC;jcv{7BXnwb>i;Zyf)(w=Q+}+pNbTv-pHgdIwCk^trwz(Q?rjt(hu; zmL8L~d|}-1)ympolKsa|Yf8?(<5_dFEcEUdtK@}xp9^;^+?|svDpGaonDr+n``bwlNa(5HsKE$oj&_>!bkvi@)No)^h2ExT6}>_Tt_^?Oo2r$@>~IEk{r6B^8x?$#S9AzWSP?#qWhA=RI%0dJhA)5&>+mn1fMr;x-Iab|OF}7Q;|WQrsqi$|(fcjKw5G$%@+))WCj;!xUIa zi`yJj*C={m1~#JPCDxR1ET$kzVu&fQ^xTb9kbuf!1n32tg0*B0@MdKLDH8<30$};` I$`ix`07xCJc>n+a literal 0 HcmV?d00001 diff --git a/firmware/include/pentabug/matrix.h b/firmware/include/pentabug/matrix.h new file mode 100644 index 0000000..a4fd56d --- /dev/null +++ b/firmware/include/pentabug/matrix.h @@ -0,0 +1,14 @@ +#ifndef MATRIX_H +#define MATRIX_H + +#include + +void matrix_start(void); +void matrix_stop(void); + +void matrix_show(void); +void matrix_init(void); + +void matrix_set(uint8_t x, uint8_t y, uint8_t active); + +#endif /* MATRIX_H */ diff --git a/firmware/lib/matrix.c b/firmware/lib/matrix.c new file mode 100644 index 0000000..35826c8 --- /dev/null +++ b/firmware/lib/matrix.c @@ -0,0 +1,70 @@ +#include + +#include +#include + +static uint8_t pixels[9]; +static uint8_t index; + +void matrix_init(void) { + DDRD |= (1 << 5) | (1 << 6) | (1 << 7); + DDRC |= (1 << 4) | (1 << 5); + DDRB |= 1 << 2; +} + +static void move_line(uint8_t line) { + PORTD &= ~0xe0; + PORTD |= 1 << (line + 5); +} + +static void write_line(uint8_t data[]) { + PORTC |= (1 << 5) | (1 << 4); + PORTB |= 1 << 2; + + if(data[0]) { + PORTC &= ~(1 << 5); + } + + if(data[1]) { + PORTC &= ~(1 << 4); + } + + if(data[2]) { + PORTB &= ~(1 << 2); + } +} + +static void matrix_int(void) { + ++index; + + if(index >= 3) { + index = 0; + } + + move_line(index); + write_line(pixels + (index * 3)); +} + +void matrix_start(void) { + matrix_init(); + start_timer(PRESCALE_64, 125, matrix_int); +} + +void matrix_stop(void) { + stop_timer(); +} + +void matrix_show(void) { + uint8_t i; + + for(i = 0; i < 3; ++i) { + move_line(i); + write_line(pixels + (i * 3)); + wait_ms(3); + } +} + +void matrix_set(uint8_t x, uint8_t y, uint8_t active) { + pixels[x*3+y] = active; +} + From ccf0497c35fcb2300b016f26326c11174d0afe1a Mon Sep 17 00:00:00 2001 From: Thammi Date: Thu, 5 Sep 2013 22:15:28 +0200 Subject: [PATCH 2/2] Make blinker simpler --- firmware/apps/blinker.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/firmware/apps/blinker.c b/firmware/apps/blinker.c index 78f7e49..fc45329 100644 --- a/firmware/apps/blinker.c +++ b/firmware/apps/blinker.c @@ -11,18 +11,16 @@ static void blinker(void) { led_inv(RIGHT); led_inv(LEFT); - uint8_t i; - for(i = 0; i < 50; ++i) { - if(button_clicked(RIGHT)) { - motor_on(); - } + wait_ms(500); - if(button_clicked(LEFT)) { - motor_off(); - } - - wait_ms(10); + if(button_clicked(RIGHT)) { + motor_on(); } + + if(button_clicked(LEFT)) { + motor_off(); + } + } REGISTER(blinker, init, NULL);