dani333
Junior Member level 1
I do not know how to compile the program below by Mplab ???
The following programs with no compiler is compiling Mplab?
Or compiler that is different?
How the program should call the hex code and compiling until I get it?
Where should I go and what compiler if I act? It step by step if anyone knows that please help me...!!
#include <18f242.h>
#device ADC=8
#use delay(clock = 4000000)
#define param 19.6079
#define use_portb_lcd TRUE
#include <lcd.c>
int8 adc_data;
float adc_voltage;
void main()
{
set_tris_c(0x00);
output_c(0x00);
lcd_init();
lcd_gotoxy(1,1);
printf(lcd_putc , "PIC18 Voltage Probe");
setup_adc(ADC_CLocK_DIV_32);
setup_adc_ports(ALL_ANALOG);
set_adc_channel(0);
delay_ms(20);
while(1)
{
adc_data=read_adc();
if(adc_data >= 230)
{
output_high(pin_c0);
}
if(adc_data <= 25)
{
output_high(pin_c2);
}
if(adc_data >= 25 & adc_data <=230)
{
output_high(pin_c1);
}
adc_voltage = adc_data * param /1000;
lcd_gotoxy(1,2);
printf(lcd_putc , "Voltage = %f , Digital = %3u" , adc_voltage , adc_data);
delay_us(50);
output_c(0x00);
}
}
-----------------------------------
help me
very important to me
please help me
The following programs with no compiler is compiling Mplab?
Or compiler that is different?
How the program should call the hex code and compiling until I get it?
Where should I go and what compiler if I act? It step by step if anyone knows that please help me...!!
#include <18f242.h>
#device ADC=8
#use delay(clock = 4000000)
#define param 19.6079
#define use_portb_lcd TRUE
#include <lcd.c>
int8 adc_data;
float adc_voltage;
void main()
{
set_tris_c(0x00);
output_c(0x00);
lcd_init();
lcd_gotoxy(1,1);
printf(lcd_putc , "PIC18 Voltage Probe");
setup_adc(ADC_CLocK_DIV_32);
setup_adc_ports(ALL_ANALOG);
set_adc_channel(0);
delay_ms(20);
while(1)
{
adc_data=read_adc();
if(adc_data >= 230)
{
output_high(pin_c0);
}
if(adc_data <= 25)
{
output_high(pin_c2);
}
if(adc_data >= 25 & adc_data <=230)
{
output_high(pin_c1);
}
adc_voltage = adc_data * param /1000;
lcd_gotoxy(1,2);
printf(lcd_putc , "Voltage = %f , Digital = %3u" , adc_voltage , adc_data);
delay_us(50);
output_c(0x00);
}
}
-----------------------------------
help me
very important to me
please help me