Postingan

Menampilkan postingan dari Juni, 2017

Codingan Pengendali Panel Surya Berbasis Atmega328

Berikut adalah codingan dari pengendali panel surya berbasis Atmega328: #include <mega8.h> #include <delay.h> #asm.equ __lcd_port=0x12 ;PORTD // Alphanumeric LCD Module functions #endasm #include <lcd.h> #define ADC_VREF_TYPE 0x40 { ADMUX=adc_input | (ADC_VREF_TYPE & 0xff); // Read the ADC conversion result unsigned int read ADC (unsigned char adc_input) delay_us(10); // Delay needed for the stabilization of the ADC input voltage ADCSRA|=0x40; // Start the AD conversion while ((ADCSRA & 0x10)==0); // Wait for the AD conversion to complete ADCSRA|=0x10; return ADCW; } ldrPin 0; // Declare your global variables here #define ls PINB.0; //limit switch //kaki motor steper = arduino //#define ms1 PORTB.4;  // kuning //#define ms2 PORTB.5;  // merah //#define ms3 PORTB.6;  // biru //#define ms4 PORTB.7;  // hijau //variable int langkah=1;  //variable driver stepper motor int posisi;     //variable ...