arkadaşlar pottan okuduğum adc değeri LCD ekrana yazdıran basit bir program yapmaya calıştım fakat LCD ekranda hiç bir karakter belirmiyor gercek hayatta denemedim sadece ISI'te denedim fakat ne yaptıysam olmadı büyük ihtimal bir yeri kacırıyorum ama anlamadım YARDIMCI OLABİLİRMİSİNİZ ?.
sbit LCD_RS at RB0_bit;
sbit LCD_EN at RB1_bit;
sbit LCD_D4 at RB2_bit;
sbit LCD_D5 at RB3_bit;
sbit LCD_D6 at RB4_bit;
sbit LCD_D7 at RB5_bit;
sbit LCD_RS_Direction at TRISB0_bit;
sbit LCD_EN_Direction at TRISB1_bit;
sbit LCD_D4_Direction at TRISB2_bit;
sbit LCD_D5_Direction at TRISB3_bit;
sbit LCD_D6_Direction at TRISB4_bit;
sbit LCD_D7_Direction at TRISB5_bit;
unsigned adc_sinyal;
char yaz[4];
void main() {
Lcd_Init();
Lcd_Cmd(_LCD_CURSOR_OFF);
LCD_Cmd(_LCD_CLEAR);
Delay_ms(100);
Lcd_Out(1,1,"FURKAN KELESOGLU");
Lcd_Out(2,2," ADC OKUMA ");
delay_ms(2000);
LCD_Cmd(_LCD_CLEAR);
ADCON0 = 0X0C;
ADCON1 &= 0XF0;
CMCON |=7;
TRISD=0;
PORTD=0;
TRISC=0;
PORTC=0;
TRISB=0;
PORTB=0;
TRISA = 0xFF;
while(1)
{
adc_sinyal = ADC_Read(2);
floattoStr(adc_sinyal,yaz);
Lcd_Out(1,1,"FURKAN KELESOGLU");
Lcd_Out(2,1,"ADC DEG:");
Lcd_Out(2,9,yaz);
}
}
(https://s14.postimg.cc/6ljll9i3x/pic_deneme.png) (https://postimg.cc/image/6ljll9i3x/)
Kurduğum devrede resim'de şimdiden yardımcı olacaklara teşekkür ediyorum.
sbit LCD_RS at RB0_bit;
sbit LCD_EN at RB1_bit;
sbit LCD_D4 at RB2_bit;
sbit LCD_D5 at RB3_bit;
sbit LCD_D6 at RB4_bit;
sbit LCD_D7 at RB5_bit;
sbit LCD_RS_Direction at TRISB0_bit;
sbit LCD_EN_Direction at TRISB1_bit;
sbit LCD_D4_Direction at TRISB2_bit;
sbit LCD_D5_Direction at TRISB3_bit;
sbit LCD_D6_Direction at TRISB4_bit;
sbit LCD_D7_Direction at TRISB5_bit;
unsigned adc_sinyal;
char yaz[4];
void main() {
ADCON0 = 0X0C;
ADCON1 &= 0XF0;
CMCON |=7;
TRISD=0;
PORTD=0;
TRISC=0;
PORTC=0;
TRISB=0;
PORTB=0;
TRISA = 0xFF;
Lcd_Init();
Lcd_Cmd(_LCD_CURSOR_OFF);
LCD_Cmd(_LCD_CLEAR);
Delay_ms(100);
Lcd_Out(1,1,"FURKAN KELESOGLU");
Lcd_Out(2,2," ADC OKUMA ");
delay_ms(2000);
LCD_Cmd(_LCD_CLEAR);
while(1)
{
adc_sinyal = ADC_Read(2);
floattoStr(adc_sinyal,yaz);
Lcd_Out(1,1,"FURKAN KELESOGLU");
Lcd_Out(2,1,"ADC DEG:");
Lcd_Out(2,9,yaz);
}
}
Alıntı yapılan: mehmet - 05 Ocak 2018, 13:16:17
sbit LCD_RS at RB0_bit;
sbit LCD_EN at RB1_bit;
sbit LCD_D4 at RB2_bit;
sbit LCD_D5 at RB3_bit;
sbit LCD_D6 at RB4_bit;
sbit LCD_D7 at RB5_bit;
sbit LCD_RS_Direction at TRISB0_bit;
sbit LCD_EN_Direction at TRISB1_bit;
sbit LCD_D4_Direction at TRISB2_bit;
sbit LCD_D5_Direction at TRISB3_bit;
sbit LCD_D6_Direction at TRISB4_bit;
sbit LCD_D7_Direction at TRISB5_bit;
unsigned adc_sinyal;
char yaz[4];
void main() {
ADCON0 = 0X0C;
ADCON1 &= 0XF0;
CMCON |=7;
TRISD=0;
PORTD=0;
TRISC=0;
PORTC=0;
TRISB=0;
PORTB=0;
TRISA = 0xFF;
Lcd_Init();
Lcd_Cmd(_LCD_CURSOR_OFF);
LCD_Cmd(_LCD_CLEAR);
Delay_ms(100);
Lcd_Out(1,1,"FURKAN KELESOGLU");
Lcd_Out(2,2," ADC OKUMA ");
delay_ms(2000);
LCD_Cmd(_LCD_CLEAR);
while(1)
{
adc_sinyal = ADC_Read(2);
floattoStr(adc_sinyal,yaz);
Lcd_Out(1,1,"FURKAN KELESOGLU");
Lcd_Out(2,1,"ADC DEG:");
Lcd_Out(2,9,yaz);
}
}
Mehmet bey kod zaten calışmıyor
Aynısı değil, dikkat etmemişsiniz.
(https://s14.postimg.cc/pjs5v2thp/ADC.png) (https://postimg.cc/image/pjs5v2thp/)
Mehmet Bey Kodu denediğimde floattoStr komutunu hata olarak kırmızıyla ciziyor anlayamadım defalarca kontrol ettim birde bir diğer hatada lcd ayarlamalar yapıldıktan sonra mı işletmek gerekiyor'du ?
Mehmet Bey Yardım Menüsünden inceledim de yazım yanlışı yapmışım büyük küçük harf yanlışı floattoStr Değil'de FloatToStr olacakmış ilgi ve alakanız için teşekkür ederim.
Hay Allahım yarabbim yahu bu yine LCD ekranda birşey göstermiyor fırlatıcam şimdi
Konfigurasyon ayarları biraz uyuz.
(http://www.zimagez.com/miniature/ekrangrnts2018-01-0721-16-59.php)
(http://www.zimagez.com/zimage/ekrangrnts2018-01-0721-16-59.php)
Bu pic'te portB standart olarak analog olarak geliyor ve edit project sayfasından PORTB A/D sigortasının Disable yapılması gerekiyor. Burayı düzenlediniz mi?