Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Education programs by the compiler to compile mplab

Status
Not open for further replies.

dani333

Junior Member level 1
Joined
Jan 18, 2011
Messages
16
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,283
Activity points
1,408
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
 

What you mean?
Me what to do and what I use compiled?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top