Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- lcd 16x2 PART NUMBER LCD: MGD1602B-NS(W)-BBS
- segue codigo:
- #include <18f4550.h>
- #device adc=10
- #FUSES NOWDT //No Watch Dog Timer
- #FUSES HS //Crystal osc <= 4mhz
- #FUSES PUT //Power Up Timer
- #FUSES NOPROTECT //Code not protected from reading
- #FUSES NODEBUG //No Debug mode for ICD
- #FUSES BROWNOUT //Reset when brownout detected
- #FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
- #FUSES NOCPD //No EE protection
- #use delay(clock=48000000)
- #include <lcd.c>
- int image[8]={
- 0b00000,
- 0b01110,
- 0b00110,
- 0b00000,
- 0b11111,
- 0b11111,
- 0b00000,
- 0b01111
- };
- int16 q1,soma;
- void main()
- {
- lcd_init();
- setup_adc_ports(AN0);
- setup_adc(ADC_CLOCK_DIV_8);
- set_adc_channel(0);
- delay_us (20);
- while (TRUE)
- {
- q1 = read_adc();
- printf (lcd_putc,"\fAD:%ld", q1);
- delay_ms (200);
- // soma = read_EEPROM (0);
- if (q1 > 200)
- {
- soma++;
- //write_eeprom(0,soma);
- for (int x = 0; x;8;x++)
- {
- lcd_set_cgram_char(0,image[x]);
- }
- printf(lcd_putc,"eu %c vc",0);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement