<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="pl-pl">
<link rel="self" type="application/atom+xml" href="https://forum.atnel.pl/feed.php?f=23&amp;t=3221&amp;mode" />

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2013-06-07T20:34:35+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=23&amp;t=3221&amp;mode</id>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2013-06-07T20:34:35+01:00</updated>
<published>2013-06-07T20:34:35+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=3221&amp;p=38718#p38718</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=3221&amp;p=38718#p38718"/>
<title type="html"><![CDATA[Re: ATB DROID ;)]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=3221&amp;p=38718#p38718"><![CDATA[
<div class="quotetitle"><b>Quote:</b></div><div class="quotecontent"><br />Jakbym miał takie podejście to nadal bym leżał i robił w pieluchę<br /></div><br /><br />hahahaah dobrze powiedziane ... tak tak panowie, to święta racja - bo to dzięki takim projektom przeróżnym - właśnie zdobywa się to doświadczenie. <br /><br />Jak nie spróbujesz to się nie dowiesz....<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 7 cze 2013, o 20:34</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Krauser]]></name></author>
<updated>2013-06-07T20:05:56+01:00</updated>
<published>2013-06-07T20:05:56+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=3221&amp;p=38715#p38715</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=3221&amp;p=38715#p38715"/>
<title type="html"><![CDATA[Re: ATB DROID ;)]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=3221&amp;p=38715#p38715"><![CDATA[
<div class="quotetitle">Paul Dirac napisał(a):</div><div class="quotecontent"><br />Ja mam pomsyła na puzzle włąsnie na dotykowym LCD. Ale obecnie to mi trochę jednak brakuje umiejętności .<br /></div><br />Jakbym miał takie podejście to nadal bym leżał i robił w pieluchę  <img src="https://forum.atnel.pl/images/smilies/icon_lol.gif" alt=":lol:" title="Śmieje się" /> . Zacznij działać, a reszty się douczysz w trakcie. Szczerze mówiąc to najwięcej czasu poświęcasz na obmyślanie &quot;mechaniki&quot;, a nie pisanie programu. Spoko, że masz pomysł, bo dążenie do wytyczonego celu zawsze pomaga pokonać drobne przeszkody po drodze.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=465">Krauser</a> — 7 cze 2013, o 20:05</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Paul Dirac]]></name></author>
<updated>2013-06-07T18:19:36+01:00</updated>
<published>2013-06-07T18:19:36+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=3221&amp;p=38710#p38710</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=3221&amp;p=38710#p38710"/>
<title type="html"><![CDATA[Re: ATB DROID ;)]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=3221&amp;p=38710#p38710"><![CDATA[
fajnie to wygląda. Ja mam  pomsyła na puzzle włąsnie na dotykowym LCD. Ale obecnie to mi trochę jednak brakuje umiejętności <img src="https://forum.atnel.pl/images/smilies/icon_e_sad.gif" alt=":(" title="Smutny" />. <br /><br />Naprawdę szacun za kreatywność, normalnie superaśne.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=1035">Paul Dirac</a> — 7 cze 2013, o 18:19</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2013-06-02T22:59:52+01:00</updated>
<published>2013-06-02T22:59:52+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=3221&amp;p=38402#p38402</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=3221&amp;p=38402#p38402"/>
<title type="html"><![CDATA[Re: ATB DROID ;)]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=3221&amp;p=38402#p38402"><![CDATA[
<div class="quotetitle">Krauser napisał(a):</div><div class="quotecontent"><br />Do pełni szczęścia<br /></div><br /><br />Krauser na prawdę to PEŁNIA szczęścia przeglądać twoje kody jak śmigasz na tym GLCD .... ja wciąż patrzę z nieskrywaną zazdrością <img src="https://forum.atnel.pl/images/smilies/icon_e_wink.gif" alt=";)" title="Puszcza oko" /> Jak będę miał kiedyś czas się za to zabrać (a muszę mieć) to co ja nowego wymyślę ? <img src="https://forum.atnel.pl/images/smilies/icon_e_wink.gif" alt=";)" title="Puszcza oko" /> przez ciebie już nic chyba ciekawszego.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 2 cze 2013, o 22:59</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Krauser]]></name></author>
<updated>2013-06-02T21:40:38+01:00</updated>
<published>2013-06-02T21:40:38+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=3221&amp;p=38400#p38400</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=3221&amp;p=38400#p38400"/>
<title type="html"><![CDATA[Re: ATB DROID ;)]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=3221&amp;p=38400#p38400"><![CDATA[
Do pełni szczęścia  <img src="https://forum.atnel.pl/images/smilies/icon_e_wink.gif" alt=";)" title="Puszcza oko" />  brakuje tylko plików projektu i obrazków z karty SD.<br />Plik main.h:<br />[syntax=c]/*<br /> * main.h<br /> *<br /> *  Created on: 18-05-2013<br /> */<br /><br />#ifndef MAIN_H_<br />#define MAIN_H_<br /><br />#include &lt;avr/io.h&gt;<br />#include &lt;avr/interrupt.h&gt;<br />#include &lt;avr/pgmspace.h&gt;<br />#include &lt;string.h&gt;<br />#include &lt;stdlib.h&gt;<br />#include &lt;util/delay.h&gt;<br />#include &lt;stdio.h&gt;<br /><br /><br />#define PCF8583_ADDR 0xA2<br />#define BG_COLOR  white<br />#define LINE_COLOR red<br />#define TOP_COLOR orange<br />#define BOT_COLOR silver<br />#define TOP_SIZE 30<br />#define BOT_SIZE 20<br />#define DEAD_AREA 3<br />#define DOUBLE_TIME 100<br />#define TOUCH_AREA 20<br />#define BOT_TEXT_X 10<br />#define BOT_TEXT_Y(SCREEN_HEIGHT-15)<br />#define ROW1 50<br />#define ROW2 110<br />#define ROW3 170<br />#define COL1 50<br />#define COL2 110<br />#define COL3 170<br />#define COL4 230<br /><br />#define SCK PB7<br />#define MISO PB6<br />#define MOSI PB5<br />#define CS PB4<br />#define CDPB3<br />#define WPPB2 /* not used */<br />#define PWR PB1<br /><br />#define BUZPB0<br /><br />#define unused_pins (1&lt;&lt;PD0) | (1&lt;&lt;PD1) | (1&lt;&lt;PD3) | (1&lt;&lt;PD4) | (1&lt;&lt;PD5) | (1&lt;&lt;PD6) | (1&lt;&lt;PD7)<br /><br />#define SD_ON PORTB &amp;= ~(1&lt;&lt;PWR)<br />#define SD_OFF PORTB |= (1&lt;&lt;PWR)<br /><br />#define SD_SLOT_EMPTY (PINB &amp; (1&lt;&lt;CD))<br /><br />void sd_pwr( uint8_t OnOff );<br />#define powerOn 1<br />#define powerOff 0<br /><br />static inline void short_beep(void)<br />{<br />PORTB |= (1&lt;&lt;BUZ);<br />_delay_ms(5);<br />PORTB &amp;= ~(1&lt;&lt;BUZ);<br />}<br /><br />static inline void spi_init(void)<br />{<br />/* init SPI and SD pins */<br />DDRB |= (1&lt;&lt;CS)|(1&lt;&lt;MOSI)|(1&lt;&lt;SCK)|(1&lt;&lt;PWR);<br />PORTB |= (1&lt;&lt;CS)|(1&lt;&lt;PWR) | (1&lt;&lt;CD) | (1&lt;&lt;WP);<br />SPCR |= (1&lt;&lt;SPE)|(1&lt;&lt;MSTR);<br />SPSR |= (1&lt;&lt;SPI2X);/* max SCK clock */<br /><br />/* init buzzer and unused pins*/<br />DDRB |= (1&lt;&lt;BUZ);<br />PORTD |= unused_pins;<br />}<br /><br />uint8_t dec2bcd(uint8_t dec);<br />uint8_t bcd2dec(uint8_t bcd);<br /><br />static void __init3( void ) __attribute__ (( section( &quot;.init3&quot; ), naked, used ));<br /><br />#endif /* MAIN_H_ */[/syntax]<br />Plik main.c:<br />[syntax=c]/*<br /> * main.c<br /> *<br /> *  Created on: 18-05-2013<br /> */<br /><br />#include &quot;main.h&quot;<br />#include &quot;MK_SSD1963/MK_SSD1963.h&quot;<br />#include &quot;I2C_TWI/i2c_twi.h&quot;<br />#include &quot;MK_STMPE811/mk_stmpe811.h&quot;<br />#include &quot;PetitFS/pff.h&quot;<br /><br />volatile uint8_t timer1 = 5, timer2, timer3, timer4 = 3, timer5;<br />volatile uint8_t time_flag;<br /><br />/* buffer for SD/MMC */<br />uint16_t SD_BUF_SIZE = 1024;<br />uint8_t sd_buffer&#91;1024&#93;;<br />/* pointer to SD buffer */<br />uint8_t *sd_buf = sd_buffer;<br /><br />/* main function */<br />int main(void) {<br /><br />uint8_t lock = 0, init = 0, y&#91;4&#93; = {0, 0, 0, 0}, i = 0;<br />uint16_t x&#91;2&#93; = {0, 0};<br />enum {first, second, old, new, };<br />uint16_t scr;<br /><br />enum {ss=1, mm, hh};<br />uint8_t buffer&#91;4&#93;;/* buffer for I2C */<br />uint8_t seconds, minutes, hours;<br /><br />FATFS Fs; /* File system object */<br />DIR Dir;/* Directory object */<br />FILINFO Fno;/* File information */<br /><br />OCR0A = F_CPU/100/1024; //~100Hz<br />TCCR0A |= (1&lt;&lt;WGM01);<br />TCCR0B |= (1&lt;&lt;CS02) | (1&lt;&lt;CS00);<br />TIMSK0 |= (1&lt;&lt;OCIE0A);<br /><br />i2cSetBitrate(400);/* I2C speed */<br /><br />spi_init(); /* SPI, buzzer, and empty port initialization */<br /><br />tft_init();/* TFT LCD initialization */<br /><br />stmpe811_init(); /* STMPE811 initialization */<br /><br />/* RTC */<br />PORTD |= (1 &lt;&lt; PD3); /* pull up */<br />EIMSK |= (1 &lt;&lt; INT1);<br />EICRA |= (1 &lt;&lt; ISC11); /* falling edge */<br /><br />sei();/* enable interrupts */<br /><br />setCurrentFont(&amp;CourierNew12ptFontInfo);<br /><br /><br /><br />fx_ptr = SSDXBUF0;<br />tft_fill_rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, black);<br />tft_fill_rect(0, 0, SCREEN_WIDTH, TOP_SIZE - 2, TOP_COLOR); /* top bar */<br />Set_color32(black);<br />tft_line(0, TOP_SIZE - 1, SCREEN_WIDTH-1, TOP_SIZE - 1);<br />Set_color32(black);<br />tft_line(0, SCREEN_HEIGHT - BOT_SIZE, SCREEN_WIDTH-1, SCREEN_HEIGHT - BOT_SIZE);<br />tft_fill_rect(0, SCREEN_HEIGHT - BOT_SIZE + 1, SCREEN_WIDTH, BOT_SIZE - 1, BOT_COLOR); /* bottom bar */<br /><br />while(1)<br />{<br />sd_pwr(powerOff);<br />if( SD_SLOT_EMPTY )<br />{<br />tft_puts_P( BOT_TEXT_X, BOT_TEXT_Y, PSTR(&quot;insert SD Card&quot;), black, BOT_COLOR );<br />continue;/* if no card detected back to the beginning of the loop */<br />}<br />sd_pwr(powerOn);<br /><br />if (pf_mount(&amp;Fs))<br />{<br />tft_puts_P( BOT_TEXT_X, BOT_TEXT_Y, PSTR(&quot;FS Error                &quot;), black, BOT_COLOR );<br />continue;<br />}<br /><br />if (pf_opendir(&amp;Dir, &quot;&quot;))/* Open directory (root dir) */<br />{<br />tft_puts_P( BOT_TEXT_X, BOT_TEXT_Y, PSTR(&quot;Open failed             &quot;), black, BOT_COLOR );<br />continue;<br />}<br />else<br />{<br />tft_puts_P( BOT_TEXT_X, BOT_TEXT_Y, PSTR(&quot;                        &quot;), black, BOT_COLOR );<br />break;<br />}<br />}<br />set_partial_area(120, 121 ); /* selected area - 1 line */<br />enter_partial_mode(); /* show only selected area */<br /><br />tft_puts_P( BOT_TEXT_X, BOT_TEXT_Y, PSTR(&quot;Loading...&quot;), black, BOT_COLOR );<br />fx_ptr = SSDXBUF0;<br />tft_bitmap_from_file( 0, 0, &quot;pasek.rg8&quot;, NULL );<br />tft_bitmap_from_file( 0, TOP_SIZE, &quot;atb.rg8&quot;, NULL );<br />tft_fill_rect(9, 5, 100, 19, black);<br />tft_fill_rect(10, 6, 98, 17, white);<br /><br />for(uint8_t i = 0; i&lt; 120; i++) /* show slowly */<br />{<br />set_partial_area(120-i, 121+i );<br />_delay_ms(10);<br />}<br />enter_normal_mode();<br /><br />fx_ptr = SSDXBUF1;<br />tft_bitmap_from_file( 0, 0, &quot;bg1.rg8&quot;, NULL ); /* load background */<br />/* load icons */<br />tft_bitmap_from_file( COL1, ROW1, &quot;budzik.rg8&quot;, NULL );<br />tft_bitmap_from_file( COL2, ROW1, &quot;gps.rg8&quot;, NULL );<br />tft_bitmap_from_file( COL3, ROW1, &quot;kalendar.rg8&quot;, NULL );<br />/*empty */<br /><br />tft_bitmap_from_file( COL1, ROW2, &quot;list.rg8&quot;, NULL );<br />tft_bitmap_from_file( COL2, ROW2, &quot;mapa.rg8&quot;, NULL );<br />tft_bitmap_from_file( COL3, ROW2, &quot;nuta.rg8&quot;, NULL );<br />tft_bitmap_from_file( COL4, ROW2, &quot;notatki.rg8&quot;, NULL );<br /><br />tft_bitmap_from_file( COL1, ROW3, &quot;sms.rg8&quot;, NULL );<br />/* empty */<br />tft_bitmap_from_file( COL3, ROW3, &quot;zdjecie.rg8&quot;, NULL );<br />tft_bitmap_from_file( COL4, ROW3, &quot;kalk.rg8&quot;, NULL );<br /><br />fx_ptr = SSDXBUF2;<br />tft_bitmap_from_file( 0, 0, &quot;bg2.rg8&quot;, NULL );<br /><br />tft_bitmap_from_file( COL1, ROW1, &quot;minut.rg8&quot;, NULL );<br />tft_bitmap_from_file( COL2, ROW1, &quot;kolko.rg8&quot;, NULL );<br />tft_bitmap_from_file( COL3, ROW1, &quot;kostka.rg8&quot;, NULL );<br />tft_bitmap_from_file( COL4, ROW1, &quot;kula.rg8&quot;, NULL );<br /><br />/* empty */<br />/* empty */<br />tft_bitmap_from_file( COL3, ROW2, &quot;woda.rg8&quot;, NULL );<br />tft_bitmap_from_file( COL4, ROW2, &quot;temp.rg8&quot;, NULL );<br /><br />tft_bitmap_from_file( COL1, ROW3, &quot;usart.rg8&quot;, NULL );<br />tft_bitmap_from_file( COL2, ROW3, &quot;volt.rg8&quot;, NULL );<br />tft_bitmap_from_file( COL3, ROW3, &quot;pwm.rg8&quot;, NULL );<br />tft_bitmap_from_file( COL4, ROW3, &quot;led.rg8&quot;, NULL );<br /><br />fx_ptr = SSDXBUF3;<br />tft_bitmap_from_file( 0, 0, &quot;bg3.rg8&quot;, NULL );<br /><br />tft_bitmap_from_file( COL1, ROW1, &quot;kulki.rg8&quot;, NULL );<br />tft_bitmap_from_file( COL2, ROW1, &quot;tetris.rg8&quot;, NULL );<br />tft_bitmap_from_file( COL3, ROW1, &quot;kostka.rg8&quot;, NULL );<br />/* empty */<br />/* empty row */<br />/* empty row */<br /><br />fx_ptr = SSDXBUF4;<br />tft_bitmap_from_file( 0, 0, &quot;bg4.rg8&quot;, NULL );<br />/* empty */<br />/* empty */<br />/* empty */<br />tft_bitmap_from_file( COL4, ROW1, &quot;strzelec.rg8&quot;, NULL );<br /><br />tft_bitmap_from_file( COL1, ROW2, &quot;lot.rg8&quot;, NULL );<br />tft_bitmap_from_file( COL2, ROW2, &quot;krolik.rg8&quot;, NULL );<br />/* empty */<br />/* empty */<br /><br />/* empty */<br />tft_bitmap_from_file( COL2, ROW3, &quot;stoper.rg8&quot;, NULL );<br />/* empty */<br />/* empty */<br /><br /><br />setCurrentFont(&amp;CourierNew12ptFontInfo);<br />fx_ptr = SSDXBUF0;<br />tft_puts_P( BOT_TEXT_X, BOT_TEXT_Y, PSTR(&quot;                        &quot;), black, BOT_COLOR );<br /><br />set_scroll_area(TOP_SIZE, SCREEN_HEIGHT - TOP_SIZE - BOT_SIZE , BOT_SIZE); /* 2 bars - top and bottom */<br />scr = SSDXBUF1 + TOP_SIZE;<br />setxbuf(scr);<br /><br />/* main loop */<br />while(1) {<br />if(!init)<br />{<br />init = 1;<br />}<br />if( !timer1 )<br />{<br />timer1 = 5;<br />if (st_intX_flag) /* screen touched */<br />{<br />if(!lock)<br />{<br />if(y&#91;first&#93; == 0)/* for double click */<br />{<br />y&#91;first&#93; = y&#91;old&#93; = y&#91;new&#93; = TP_Y; /* y&#91;new&#93; for moving */<br />x&#91;first&#93; = TP_X;<br />timer3 = DOUBLE_TIME;<br />}<br />else<br />{<br />y&#91;second&#93; = y&#91;old&#93; = y&#91;new&#93; = TP_Y; /* y&#91;new&#93; for moving */<br />x&#91;second&#93; = TP_X;<br />fx_ptr = SSDXBUF0;<br /><br />if( ((y&#91;first&#93; &gt; y&#91;second&#93;) &amp;&amp; (y&#91;first&#93; - y&#91;second&#93; &lt; TOUCH_AREA))<br />|| ((y&#91;first&#93; &lt; y&#91;second&#93;) &amp;&amp; (y&#91;second&#93; - y&#91;first&#93; &lt; TOUCH_AREA)) )<br />tft_puts(10, BOT_TEXT_Y, &quot;OK&quot;, black, BOT_COLOR );<br />else<br />tft_puts(10, BOT_TEXT_Y, &quot;   &quot;, black, BOT_COLOR );<br /><br />}<br />lock = 1; /* lock until released */<br />}/* if(!lock) */<br />y&#91;new&#93; = TP_Y; /* for scrolling */<br />x&#91;new&#93; = TP_X;<br />/* display touched position */<br />fx_ptr = SSDXBUF0;<br />tft_puts_P(180, BOT_TEXT_Y, PSTR(&quot;X=&quot;), black, BOT_COLOR );<br />if(x&#91;new&#93;/100 == 0 &amp;&amp; x&#91;new&#93;/10 == 0)<br />{<br />tft_puts_P(CX, CY, PSTR(&quot;00&quot;), black, BOT_COLOR );<br />tft_putint(CX, CY, x&#91;new&#93;, black, BOT_COLOR);<br />}<br />else if(x&#91;new&#93;/100 == 0 &amp;&amp; x&#91;new&#93;/10 != 0)<br />{<br />tft_puts_P(CX, CY, PSTR(&quot;0&quot;), black, BOT_COLOR );<br />tft_putint(CX, CY, x&#91;new&#93;, black, BOT_COLOR);<br />}<br />else<br />tft_putint(CX, CY, x&#91;new&#93;, black, BOT_COLOR);<br />tft_puts_P(CX, CY, PSTR(&quot; Y=&quot;), black, BOT_COLOR );<br />if(y&#91;new&#93;/100 == 0 &amp;&amp; y&#91;new&#93;/10 == 0)<br />{<br />tft_puts_P(CX, CY, PSTR(&quot;00&quot;), black, BOT_COLOR );<br />tft_putint(CX, CY, y&#91;new&#93;, black, BOT_COLOR);<br />}<br />else if(y&#91;new&#93;/100 == 0 &amp;&amp; y&#91;new&#93;/10 != 0)<br />{<br />tft_puts_P(CX, CY, PSTR(&quot;0&quot;), black, BOT_COLOR );<br />tft_putint(CX, CY, y&#91;new&#93;, black, BOT_COLOR);<br />}<br />else<br />tft_putint(CX, CY, y&#91;new&#93;, black, BOT_COLOR);<br />/* move screen when touched position was changed */<br />if( y&#91;new&#93; &lt; y&#91;old&#93; )<br />{<br />if ((scr &lt; SSDXBUF4 + TOP_SIZE) &amp;&amp; (y&#91;old&#93; - y&#91;new&#93; &gt; DEAD_AREA)) scr += y&#91;old&#93; - y&#91;new&#93;;<br />if (scr &gt; SSDXBUF4 + TOP_SIZE) scr = SSDXBUF4 + TOP_SIZE;<br />setxbuf(scr);<br />}<br />else<br />{<br />if (scr &gt; SSDXBUF1 + TOP_SIZE &amp;&amp; (y&#91;new&#93; - y&#91;old&#93; &gt; DEAD_AREA)) scr -= y&#91;new&#93; - y&#91;old&#93;;<br />if (scr &lt; SSDXBUF1 + TOP_SIZE) scr = SSDXBUF1 + TOP_SIZE;<br />setxbuf(scr);<br />}<br />y&#91;old&#93; = y&#91;new&#93;;<br />st_intX_flag = 0;<br />timer2 = 10;<br />} /* if (st_intX_flag) */<br />}<br />if( !timer2 &amp;&amp; lock) /* when release the screen */<br />{<br />lock = 0;<br />/* auto center each screen */<br />if (scr &lt; SSDXBUF1 + SSDXBUF1/2 + TOP_SIZE)<br />{<br />scr = SSDXBUF1 + TOP_SIZE;<br />setxbuf(scr);<br />}<br />else if ((scr &gt; SSDXBUF1 + SSDXBUF1/2 + TOP_SIZE) &amp;&amp; (scr &lt; SSDXBUF2 + SSDXBUF1/2 + TOP_SIZE))<br />{<br />scr = SSDXBUF2 + TOP_SIZE;<br />setxbuf(scr);<br />}<br />else if ((scr &gt; SSDXBUF2 + SSDXBUF1/2 + TOP_SIZE) &amp;&amp; (scr &lt; SSDXBUF3 + SSDXBUF1/2 + TOP_SIZE))<br />{<br />scr = SSDXBUF3 + TOP_SIZE;<br />setxbuf(scr);<br />}<br />else<br />{<br />scr = SSDXBUF4 + TOP_SIZE;<br />setxbuf(scr);<br />}<br />}/* if( !timer2 &amp;&amp; lock) */<br />if(!timer3)<br />{<br />y&#91;first&#93; = y&#91;second&#93; = 0;<br />}<br />if(!timer4) /* auto hide status bar */<br />{<br />timer4 = 3;<br />if (st_intX_flag) /* screen touched */<br />{<br />i = 0;<br />timer5 = 50; /* wait before hide */<br />}<br />else if(!timer5)<br />{<br />if(i &lt; BOT_SIZE) i++;<br />fx_ptr = SSDXBUF0;<br />tft_puts(10, BOT_TEXT_Y, &quot;              &quot;, black, BOT_COLOR ); /* clean */<br />tft_puts(180, BOT_TEXT_Y, &quot;              &quot;, black, BOT_COLOR ); /* clean */<br />}<br />/* hide status bar */<br />set_scroll_area(TOP_SIZE, SCREEN_HEIGHT - TOP_SIZE - BOT_SIZE + i , BOT_SIZE - i);<br />}/* if(!timer4) */<br />if(time_flag)<br />{<br />time_flag = 0;<br />fx_ptr = SSDXBUF0;<br />/* disable touch panel interrupts */<br />#if USE_IRQ_NR == 0<br />EIMSK &amp;= ~(1 &lt;&lt; INT0);<br />#elif USE_IRQ_NR == 1<br />EIMSK &amp;= ~(1 &lt;&lt; INT1);<br />#elif USE_IRQ_NR == 2<br />EIMSK &amp;= ~(1 &lt;&lt; INT2);<br />#endif<br />/* read 4 bytes to the buffer starting at address 0x01 from RTC's RAM */<br />TWI_read_buf( PCF8583_ADDR, 0x01, 4, buffer );<br />/* enable touch panel interrupt */<br />#if USE_IRQ_NR == 0<br />EIMSK |= (1 &lt;&lt; INT0);<br />#elif USE_IRQ_NR == 1<br />EIMSK |= (1 &lt;&lt; INT1);<br />#elif USE_IRQ_NR == 2<br />EIMSK |= (1 &lt;&lt; INT2);<br />#endif<br />seconds = bcd2dec( buffer&#91;ss&#93; );<br />minutes = bcd2dec( buffer&#91;mm&#93; );<br />hours = bcd2dec( buffer&#91;hh&#93; );<br /><br />/* display time on TFT */<br />if( hours &lt; 10 )<br />{<br />tft_puts_P(13, 9, PSTR(&quot;0&quot;), black, white);<br />tft_putint(CX, CY, hours, black, white);<br />}<br />else<br />{<br />tft_putint(13, 9, hours, black, white);<br />}<br />tft_puts_P(CX, CY, PSTR(&quot;:&quot;), black, white);<br />if( minutes &lt; 10 ) tft_puts_P(CX, CY, PSTR(&quot;0&quot;), black, white);<br />tft_putint(CX, CY, minutes, black, white);<br />tft_puts_P(CX, CY, PSTR(&quot;:&quot;), black, white);<br />if( seconds &lt; 10 ) tft_puts_P(CX, CY, PSTR(&quot;0&quot;), black, white);<br />tft_putint(CX, CY, seconds, black, white);<br />}/* if(time_flag) */<br />}/* while(1) */<br />}/* main() */<br /><br />ISR(TIMER0_COMPA_vect)<br />{<br />uint8_t n;<br />n = timer1;/* 100Hz timer1 */<br />if (n) timer1 = --n;<br />n = timer2;/* 100Hz timer2 */<br />if (n) timer2 = --n;<br />n = timer3;/* 100Hz timer3 */<br />if (n) timer3 = --n;<br />n = timer4;/* 100Hz timer4 */<br />if (n) timer4 = --n;<br />n = timer5;/* 100Hz timer5 */<br />if (n) timer5 = --n;<br />}<br /><br />#if USE_IRQ_NR != 1<br />ISR(INT1_vect)<br />{<br />time_flag = 1;<br />}<br />#endif<br /><br />void sd_pwr( uint8_t OnOff ) {<br />if(OnOff) {<br />SD_ON;<br />SPCR |= (1&lt;&lt;SPE)|(1&lt;&lt;MSTR);<br />_delay_ms(50);<br />disk_initialize();<br />} else {<br />SPCR &amp;= ~(1&lt;&lt;SPE);<br />PORTB &amp;= ~((1&lt;&lt;SCK)|(1&lt;&lt;MISO)|(1&lt;&lt;MOSI));<br />SD_OFF;<br />_delay_ms(50);<br />}<br />}<br /><br />uint8_t dec2bcd(uint8_t dec) {<br />return ((dec / 10)&lt;&lt;4) | (dec % 10);<br />}<br /><br />uint8_t bcd2dec(uint8_t bcd) {<br />    return ((((bcd) &gt;&gt; 4) &amp; 0x0F) * 10) + ((bcd) &amp; 0x0F);<br />}<br /><br /><br />static void __init3( void )<br />{<br />    MCUSR = 0;<br />    WDTCSR = (1&lt;&lt;WDCE) | (1&lt;&lt;WDE);<br />    WDTCSR = 0;<br />}[/syntax]<br /><br />Projekt nie jest jeszcze skończony. Nie można uruchomić żadnej akcji klikając na ikonki. Dlatego też można spodziewać się jeszcze pewnych zmian.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=465">Krauser</a> — 2 cze 2013, o 21:40</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[kacperu2]]></name></author>
<updated>2013-05-31T18:30:18+01:00</updated>
<published>2013-05-31T18:30:18+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=3221&amp;p=38184#p38184</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=3221&amp;p=38184#p38184"/>
<title type="html"><![CDATA[Re: ATB DROID ;)]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=3221&amp;p=38184#p38184"><![CDATA[
Dajcie mi tylko SDK jako plugin do Eclipse ;D<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=1258">kacperu2</a> — 31 maja 2013, o 18:30</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Ledes]]></name></author>
<updated>2013-05-31T16:54:58+01:00</updated>
<published>2013-05-31T16:54:58+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=3221&amp;p=38179#p38179</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=3221&amp;p=38179#p38179"/>
<title type="html"><![CDATA[Re: ATB DROID ;)]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=3221&amp;p=38179#p38179"><![CDATA[
To pikuś. Wystarczy obadać, czy x i y mieści się w żądanym obszarze i odpowiednio zareagować.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=355">Ledes</a> — 31 maja 2013, o 16:54</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mg101]]></name></author>
<updated>2013-05-31T15:38:04+01:00</updated>
<published>2013-05-31T15:38:04+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=3221&amp;p=38173#p38173</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=3221&amp;p=38173#p38173"/>
<title type="html"><![CDATA[Re: ATB DROID ;)]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=3221&amp;p=38173#p38173"><![CDATA[
I jak tu nie być zawistnym! Pokłon aż do samej ziemi dla Krausera. Jeszcze tylko takie pytanie. Czy daleko stąd do tego, żeby np. po dotknięciu ikonki zegara pojawił się czas? To samo dotyczy innych ikonek.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=683">mg101</a> — 31 maja 2013, o 15:38</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[komor34]]></name></author>
<updated>2013-05-30T11:59:11+01:00</updated>
<published>2013-05-30T11:59:11+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=3221&amp;p=38048#p38048</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=3221&amp;p=38048#p38048"/>
<title type="html"><![CDATA[Re: ATB DROID ;)]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=3221&amp;p=38048#p38048"><![CDATA[
Świetna robota <img src="https://forum.atnel.pl/images/smilies/icon_e_smile.gif" alt=":)" title="Szczęśliwy" /> Nie mogę się doczekać, kiedy ja będę miał takie umiejętności <img src="https://forum.atnel.pl/images/smilies/icon_e_biggrin.gif" alt=":D" title="Bardzo szczęśliwy" /><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=495">komor34</a> — 30 maja 2013, o 11:59</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Anonymous]]></name></author>
<updated>2013-05-30T11:38:28+01:00</updated>
<published>2013-05-30T11:38:28+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=3221&amp;p=38044#p38044</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=3221&amp;p=38044#p38044"/>
<title type="html"><![CDATA[Re: ATB DROID ;)]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=3221&amp;p=38044#p38044"><![CDATA[
No jak by to wrzucić na Atmega2560 hmmmm, aż mnie korci by się pobawić<p>Statystyki: Napisane przez Gość — 30 maja 2013, o 11:38</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2013-05-30T11:36:01+01:00</updated>
<published>2013-05-30T11:36:01+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=3221&amp;p=38043#p38043</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=3221&amp;p=38043#p38043"/>
<title type="html"><![CDATA[Re: ATB DROID ;)]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=3221&amp;p=38043#p38043"><![CDATA[
<div class="quotetitle">Krauser napisał(a):</div><div class="quotecontent"><br />Nie mamy co prawda do dyspozycji znacznie szybszego procesora Qualcomm Snapdragon, ale za to możemy sobie to zmontować w domowym zaciszu<br /></div><br /><br />Prześliczne podsumowanie <img src="https://forum.atnel.pl/images/smilies/icon_e_wink.gif" alt=";)" title="Puszcza oko" /> hahahaha <br /><br />a jeśli chodzi o pomysł na projekt ..... eeeeeh co tu dużo mówić, wielki SZACUN kolego Krauser<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 30 maja 2013, o 11:36</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Krauser]]></name></author>
<updated>2013-05-30T10:38:18+01:00</updated>
<published>2013-05-30T10:38:18+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=3221&amp;p=38037#p38037</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=3221&amp;p=38037#p38037"/>
<title type="html"><![CDATA[ATB DROID ;)]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=3221&amp;p=38037#p38037"><![CDATA[
<img src="http://forum.atnel.pl/_obrazki/o/54/18b893b1ef0a3ad5fdbc107eba2cf41b.png" alt="Obrazek" /><br /><br /><div style="width: 583px; height: 471px; margin: 0 auto; padding-left: 26px; padding-top: 48px; background: url('https://www.atnel.pl/download/atnel_tv.png') no-repeat;"> <strong>iframe</strong> </div><br /><strong>WSTĘNIAK</strong><br />Skoro już ATMEAGA dostała dotykowy, kolorowy ekran to dlaczego by nie wykorzystać tego sprzętu do budowy jakiegoś większego systemu na wzór telefonów z Androidem. Nie mamy co prawda do dyspozycji znacznie szybszego procesora Qualcomm Snapdragon, ale za to możemy sobie to zmontować w domowym zaciszu  <img src="https://forum.atnel.pl/images/smilies/icon_mrgreen.gif" alt=":mrgreen:" title="Pan Zielony" /> <br />Temat składa się z kilku części z których pierwsza to przygotowanie &quot;środowiska&quot; do uruchamiania różnorakich funkcji (podprogramów). Jak wiadomo (z książki Mirosława Kardasia &quot;Język C Pasja programowania mikrokontrolerów 8-bitowych&quot;) wyświetlacz ze sterownikiem SSD1963 posiada dodatkową pamięć, którą można zapełnić w tle i potem szybko &quot;rzutować&quot; na widzialną część ekranu. Można również płynnie przewijać tą pamięć przez okno wyświetlacza co pokazano wcześniej. Jest jeszcze jedna fajna moim zdaniem funkcja zaimplementowana w tym sterowniku. Możemy bowiem zablokować pewien obszar ekranu i uzyskać przykładowo 2 stałe paski na wyświetlaczu podczas, gdy pozostała część może być swobodnie zmieniania jak wcześniej. Do biblioteki MK_SSD1963 należy dodać kolejną funkcję i skorzystać z niej jak pokazano poniżej:<br />[syntax=c]//w pliku MK_SSD1963.c<br />// funkcja definiuje obszar stały i ruchomy na wyświetlaczu<br />void set_scroll_area(uint16_t top, uint16_t scroll, uint16_t bottom )<br />{<br />Write_command( 0x33 );<br />Write_data(top&gt;&gt;8);<br />Write_data(top);<br />Write_data(scroll&gt;&gt;8);<br />Write_data(scroll);<br />Write_data(bottom&gt;&gt;8);<br />Write_data(bottom);<br />}<br /><br />//w pliku main<br />#define TOP_SIZE 30 //wysokość górnego paska<br />#define BOT_SIZE 20 //wysokość dolnego paska<br />uint16_t scr;<br />set_scroll_area(TOP_SIZE, SCREEN_HEIGHT - TOP_SIZE - BOT_SIZE , BOT_SIZE); //dwa stałe paski na górze i dole<br />scr = SSDXBUF1 + TOP_SIZE;<br />setxbuf(scr);[/syntax]<br /><br />Wracając do tematu to pomysł jest następujący:<br />- w pierwszym buforze rysujemy grafikę górnego i dolnego paska, środek zostanie wykorzystany do prezentowania wybranej &quot;aplikacji&quot;<br />- w kolejnych 4 buforach kładziemy pocięta tapetę o rozmiarze 320 x 960, a na to obrazki ikonek (jest również taka opcja, by ikonki idealnie wpasować w tapetę, ale wtedy musimy przygotować obrazek wraz z ikonkami co po każdej zmianie rozkładu ikon będzie nas zmuszać do modyfikacji tej tapety - choć zaletą jest znacznie lepszy wygląd)<br />- górny pasek może służyć do prezentowania stałych informacji np. czas, data, temperatura, stan baterii<br />- dolny pasek (w tym przypadku dodatkowo z funkcja automatycznego chowania) służyć może do prezentowania aktualnych akcji np. ładowanie aplikacji<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=465">Krauser</a> — 30 maja 2013, o 10:38</p><hr />
]]></content>
</entry>
</feed>