eduardoludgero
Joined: 14 Oct 2007 Posts: 3
|
GLCD (ks0108) 128x64 - Image (bitmap) - Create? (help-me) |
Posted: Sun Oct 14, 2007 12:24 pm |
|
|
I looked at the site and did not find anything concrete on GLCD and image. So I decided to write questions to see if you can help me?
CCS compiler version: 4.049
Settings: main.h
Code: |
#include <16F877A.h>
#device adc=10
#FUSES NOWDT //No Watch Dog Timer
#FUSES LP //Low power osc < 200 khz
#FUSES NOPUT //No Power Up Timer
#FUSES NOPROTECT //Code not protected from reading
#FUSES NODEBUG //No Debug mode for ICD
#FUSES NOBROWNOUT //No brownout reset
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOCPD //No EE protection
#FUSES WRT_50% //Lower half of Program Memory is Write Protected
#use delay(clock=4000000)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)
|
Settings: main.c
Code: |
#include "main.h"
#include <GLCD.c>
#include <math.h>
//Variables of the main program
int16 lm35i, MPX5700i;
float lm35f, MPX5700f;
char TempText[] = "Temperatura: ";
char PressaoText[] = "Pressao...:: ";
char conversao[20];
//-------------------------------------------
void main()
{
setup_adc_ports(AN0_AN1_VSS_VREF);
setup_adc(ADC_CLOCK_INTERNAL);
setup_psp(PSP_DISABLED);
setup_spi(SPI_SS_DISABLED);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
// Begin CODE!
glcd_init(ON);
delay_ms(1);
glcd_fillScreen(OFF);
glcd_rect(1, 5, 126, 62, NO, ON);
glcd_text57(3, 8, TempText, 1, ON);
glcd_text57(3, 16, PressaoText, 1, ON);
do
{
// begin code - LM35 ---------------------------------------------
set_adc_channel(0); //Arrow reading in the channel AN0
delay_ms(1);
lm35i= read_adc();
delay_ms(1);
//Conversion
lm35f= (lm35i*0.0048828125*100);
delay_ms(1);
sprintf(conversao,"%f", (float)lm35f);
glcd_text57(80, 8, conversao, 1, ON);
glcd_text57(80, 8, conversao, 1, OFF);
//end code - LM35 ----------------------------------------------
//begin CODE - MPX5700A --------------------------------------------------
set_adc_channel(1); //Arrow reading in the channel AN1
delay_ms(1);
MPX5700i= read_adc();
delay_ms(1);
//Conversion
MPX5700f= (22.281*(MPX5700i*0.004882))+9.0869;
delay_ms(1);
sprintf(conversao,"%f", (float)MPX5700f);
glcd_text57(80, 16, conversao, 1, ON);
glcd_text57(80, 16, conversao, 1, OFF);
//end CODE - MPX5700A ----------------------------------------------------
}while(1);
}
|
The code in my application is posted before, now I need help putting a background image?
Thanks! (Forgiveness by my English, I am Brazilian!) |
|