Contains the main execution of the clock uses headers to import functions
Dependencies: RTC-DS1307 SPI_TFT_ILI9341 TFT_fonts mbed tsi_sensor
Fork of TFT_Mikroelectronika_IL9341_sketchpad by
Diff: drawhands.h.orig
- Revision:
- 41:3f2e75e7fbeb
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/drawhands.h.orig Fri May 26 08:32:45 2017 +0000 @@ -0,0 +1,19 @@ + +void draw_hands ( int x0 , int y0 , int r , float minutes , int hours , int color) + { + int x1,y1,x2,y2; + int rs = 0.6 * r ; // shorter moving hand + int m = minutes ; + int k = hours % 12; + double angle2 = k * M_PI / 6 ; + double angle = m * M_PI / 30 ; + x1 = r* sin(angle) + x0;//mins + y1 = r * -cos(angle) + y0; + x2 = rs * sin(angle2) + x0; //hours + y2 = rs * -cos(angle2) + y0; + TFT.line(x0, y0, x2, y2, color); + TFT.line(x0, y0, x1, y1, color); + } + + + \ No newline at end of file