29.08.2013 Views

Autonom robotväckarklocka med trådlös basstation - KTH

Autonom robotväckarklocka med trådlös basstation - KTH

Autonom robotväckarklocka med trådlös basstation - KTH

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

}<br />

}<br />

}<br />

text("TIME",95,1);<br />

text("ALARM",95,3);<br />

text("MOVE", 95,5);<br />

char x,y;<br />

struct retarr xy;<br />

xy = touch();<br />

x = xy.values[0];<br />

y = xy.values[1];<br />

showxy(x,y);<br />

send_spi(dots);<br />

if(y == 8 || y == 9){ // TIME<br />

if(x < 7 && x > 2){<br />

clear_disp();<br />

settime();<br />

}<br />

}<br />

if(y == 6 || y == 7){ // ALARM<br />

if(x < 7 && x >= 2){<br />

setalarm();<br />

}<br />

}<br />

if(y == 4 || y == 5){ // MOVE<br />

if(x < 7 && x >= 2){<br />

move();<br />

}<br />

}<br />

//------------------------------------------------------------<br />

// main<br />

//------------------------------------------------------------<br />

int main(void){<br />

init_spi(); // initiate communication through SPI, SPI_MasterInit<br />

init_disp(); // initiate display<br />

_delay_ms(100);<br />

clear_disp(); // all pixels active, empty screen

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!