Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.49 KB | None | 0 0
  1. #include <targets/AT91SAM7.h>
  2. #include "pcf8833u8_lcd.h"
  3.  
  4. int main(void){
  5.   char z[4];
  6.   char x[4];
  7.   int a, r_a=0;
  8.   InitLCD();
  9.   SetContrast(5);
  10.   Backlight(BL_ON);
  11.  LCDClearScreen();
  12.     ADC_CR=1<<0;
  13.     ADC_CHER=1<<6;
  14.     ADC_MR=(23<<ADC_MR_PRESCAL_BIT)|(1<<ADC_MR_PRESCAL_BIT)|(2<<ADC_MR_STARTUP_BIT);
  15.     ADC_CR=1<<1;//START KONWERSJI
  16.  
  17.     while((ADC_SR&(1<<6))==0){}
  18.        r_a = ADC_CDR6;
  19.        itoa(r_a,x,10);
  20.      LCDPutStr(x, 40, 20, LARGE, WHITE, BLACK);
  21.   return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement