Advertisement
mikolajmki

mikro_lab06

Dec 9th, 2022
861
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.86 KB | None | 0 0
  1. #include <targets\AT91SAM7.h>
  2. #include "pcf8833u8_lcd.h"
  3.  
  4. void czas(int ms){
  5. volatile int a,b;
  6.     for(a=0;a<=ms;a++){
  7.     for(b=0;b<=3000;b++){
  8.         __asm__("NOP");
  9.     }}}
  10.  
  11. char napis[80];
  12.  
  13. void zegar() {
  14.   while (1) {
  15.     for (int j = 0 ; j < 24 ; j ++) {
  16.       for (int i = 0 ; i < 60 ; i ++) {
  17.         sprintf(napis, "%02d:%02d", j, i);
  18.         czas(500);
  19.         LCDPutStr(napis, 100, 80, LARGE, BLACK, WHITE);
  20.       }
  21.     }
  22.   }
  23. }
  24.  
  25. int main (){
  26.  
  27.   InitLCD();
  28.   SetContrast(30);
  29.   LCDClearScreen();
  30.  
  31.   //LCDPutStr("Mikolaj", 10, 20, LARGE, BLACK, WHITE);
  32.   LCDPutStr("Mikolaj", 30, 20, MEDIUM, BLACK, WHITE);
  33.   LCDPutStr("Marcinkowski", 50, 20, MEDIUM, BLACK, WHITE);
  34.   LCDSetLine(80, 10, 80, 120, BLUE); // x0, y0, x1, y1
  35.   //LCDSetRect(80, 10, 70, 120, 0, BLUE);
  36.   //LCDSetCircle(100,66,10,GREEN);
  37.   //LCDSetCircle(100,66,9,GREEN);
  38.   zegar();
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement