Forum Sains Indonesia




*
Selamat datang, Pengunjung. Silahkan masuk atau mendaftar. Apakah anda lupa aktivasi email?
Mei 26, 2012, 01:32:34 PM

Masuk dengan nama pengguna, kata sandi dan lama sesi

Artikel Sains

Aku Cinta ForSa

  ForSa on FB  ForSa on Twitter

Pranala Luar

ShoutBox!

Last 10 Shouts:

 

fajri

Mei 24, 2012, 09:40:03 PM
numpang liat_liat dulu,, kexnya menarik bnget sama masalah mikon.. ! :D
 

haman11

Mei 24, 2012, 08:11:34 AM
ada yg tauproses daur ulang urin pada cicak gk ? ;)
 

GhostInMachine

Mei 23, 2012, 03:52:17 PM
kk mau tanya cara upload Tulisan dong??
 

army.fice

Mei 23, 2012, 12:22:47 AM
sepi banget sih :(
 

lustforscience

Mei 22, 2012, 08:26:02 PM
amin
 

exile_rstd

Mei 22, 2012, 08:24:55 PM
offline....
good night all  ;)
 

exile_rstd

Mei 22, 2012, 08:23:08 PM
iyaaaa jumat saya mau ujian kenaikan kelas. doain ya om Farabi, semoga ujiannya lancar dan dpt nilai memuaskan  :D
 

Farabi

Mei 22, 2012, 08:20:37 PM
KMana aja non? Sibuk belajar?
 

exile_rstd

Mei 22, 2012, 07:44:23 PM
argh lama ga buka forsa, comment di beberapa thread jd membingungkan saya. apa karena udh lama ga asah ya...
 

N E R R O

Mei 20, 2012, 07:41:57 PM
udah lama gak mampi ke forsa, sdh banyak berubah

Show 50 latest

Penulis Topik: tampilan di LCD memakai sensor suhu LM35 berbasis atmega8535  (Dibaca 1775 kali)

0 Anggota dan 1 Pengunjung sedang melihat topik ini.

Offline kurnia prana

  • Mahasiswa
  • **
  • Tulisan: 10
  • IQ: 7
    • Lihat Profil
tampilan di LCD memakai sensor suhu LM35 berbasis atmega8535
« pada: Januari 02, 2011, 08:19:38 PM »
ada yang tau ga program bahasa C untuk nampilin suhu di LCD 2x16 memakai atmega 8535?? please help me!!!

Offline N.A.T.O

  • Mahasiswa
  • **
  • Tulisan: 21
  • IQ: 2
    • Lihat Profil
Re: tampilan di LCD memakai sensor suhu LM35 berbasis atmega8535
« Jawab #1 pada: April 11, 2011, 11:38:26 PM »
/*****************************************************
This program was produced by the
CodeWizardAVR V1.25.9 Standard
Automatic Program Generator
© Copyright 1998-2008 Pavel Haiduc, HP InfoTech s.r.l.
pranala:http://www.hpinfotech.com [non-aktif]

Project :
Version :
unsigned int SUHU;
 char sementara[16];
 float suhu_c;

#include <mega8535.h>
#include <stdlib.h>

// Alphanumeric LCD Module functions
#asm
   .equ __lcd_port=0x15 ;PORTC
#endasm
#include <lcd.h>

// Standard Input/Output functions
#include <stdio.h>

#include <delay.h>

#define ADC_VREF_TYPE 0x40

// Read the AD conversion result
unsigned int read_adc(unsigned char adc_input)
{
ADMUX=adc_input | (ADC_VREF_TYPE & 0xff);
// Delay needed for the stabilization of the ADC input voltage
delay_us(10);
// Start the AD conversion
ADCSRA|=0x40;
// Wait for the AD conversion to complete
while ((ADCSRA & 0x10)==0);
ADCSRA|=0x10;
return ADCW;
}

// Declare your global variables here

void main(void)
{
PORTA=0x00;
DDRA=0x00;

PORTB=0x00;
DDRB=0x00;

PORTC=0x00;
DDRC=0x00;

PORTD=0x00;
DDRD=0x00;

// Timer/Counter 0 initialization
// Clock source: System Clock
// Clock value: Timer 0 Stopped
// Mode: Normal top=FFh
// OC0 output: Disconnected
TCCR0=0x00;
TCNT0=0x00;
OCR0=0x00;

// Timer/Counter 1 initialization
// Clock source: System Clock
// Clock value: Timer 1 Stopped
// Mode: Normal top=FFFFh
// OC1A output: Discon.
// OC1B output: Discon.
// Noise Canceler: Off
// Input Capture on Falling Edge
// Timer 1 Overflow Interrupt: Off
// Input Capture Interrupt: Off
// Compare A Match Interrupt: Off
// Compare B Match Interrupt: Off
TCCR1A=0x00;
TCCR1B=0x00;
TCNT1H=0x00;
TCNT1L=0x00;
ICR1H=0x00;
ICR1L=0x00;
OCR1AH=0x00;
OCR1AL=0x00;
OCR1BH=0x00;
OCR1BL=0x00;

// Timer/Counter 2 initialization
// Clock source: System Clock
// Clock value: Timer 2 Stopped
// Mode: Normal top=FFh
// OC2 output: Disconnected
ASSR=0x00;
TCCR2=0x00;
TCNT2=0x00;
OCR2=0x00;

// External Interrupt(s) initialization
// INT0: Off
// INT1: Off
// INT2: Off
MCUCR=0x00;
MCUCSR=0x00;

// Timer(s)/Counter(s) Interrupt(s) initialization
TIMSK=0x00;

// USART initialization
// Communication Parameters: 8 Data, 1 Stop, No Parity
// USART Receiver: On
// USART Transmitter: On
// USART Mode: Asynchronous
// USART Baud Rate: 9600
UCSRA=0x00;
UCSRB=0x18;
UCSRC=0x86;
UBRRH=0x00;
UBRRL=0x4D;

// Analog Comparator initialization
// Analog Comparator: Off
// Analog Comparator Input Capture by Timer/Counter 1: Off
ACSR=0x80;
SFIOR=0x00;

// ADC initialization
// ADC Clock frequency: 750.000 kHz
// ADC Voltage Reference: AVCC pin
// ADC High Speed Mode: Off
// ADC Auto Trigger Source: None
ADMUX=ADC_VREF_TYPE & 0xff;
ADCSRA=0x84;
SFIOR&=0xEF;

lcd_init(16);


while (1)
      {
        SUHU= read_adc(0);
        suhu_c=(float)SUHU*500/1023;
        sprintf(sementara,"%i",SUHU);
        lcd_clear( );lcd_gotoxy(0,0);
        lcd_puts(sementara);
        ftoa(suhu_c,1,sementara);
        lcd_gotoxy(0,1) ;
        lcd_puts(sementara);
   delay_ms(500);
      };
}

 

Copyright © 2006-2011 Forum Sains Indonesia