Zdravím
Zkoušel jsem příklad lcd displeje ten mi funguje ale po úpravě nebo přidání ADC převodníku mi hází dvě chyby
0 1 mikrocAVR.exe -MSF -DBG -pATMEGA8 -C -Y -DL -O11111114 -fo4 -N"C:\Program Files\Mikroelektronika\mikroC PRO for AVR\Examples\Development Systems\BigAVR2\Lcd\Lcd.mcpav" -SP"C:\Program Files\Mikroelektronika\mikroC PRO for AVR\defs\" -SP"C:\Program Files\Mikroelektronika\mikroC PRO for AVR\Examples\Development Systems\BigAVR2\Lcd\" -SP"C:\Program Files\Mikroelektronika\mikroC PRO for AVR\Uses\LTE64KW\" "Lcd.c" "__Lib_Math.mcl" "__Lib_MathDouble.mcl" "__Lib_System.mcl" "__Lib_Delays.mcl" "__Lib_LcdConsts.mcl" "__Lib_Lcd.mcl"
0 121 Compilation Started __Lib_Delays.c
119 122 Compiled Successfully __Lib_Delays.c
0 125 All files Preprocessed in 94 ms
0 121 Compilation Started Lcd.c
55 324 Undeclared identifier 'ADC_Read' in expression Lcd.c
56 324 Undeclared identifier 'IntToStr' in expression Lcd.c
0 102 Finished (with errors): 03 II 2011, 13:10:55 Lcd.mcpav
Zdrojový kód
/* Project name:
Lcd_Test (Demonstration of the LCD library routines)
* Copyright:
(c) Mikroelektronika, 2008.
* Revision History:
20080930:
- initial release;
* Description:
This code demonstrates how to use LCD 4-bit library. LCD is first
initialized, then some text is written, then the text is moved.
* Test configuration:
MCU: ATmega8
Dev.Board: BigAVR2
Oscillator: External Clock 4.0000 MHz
Ext. Modules: LCD 2x16 module
SW: mikroC PRO for AVR
* NOTES:
None.
*/
#include <built_in.h>
// LCD module connections
sbit LCD_RS at PORTD0_bit;
sbit LCD_EN at PORTD2_bit;
sbit LCD_D4 at PORTD4_bit;
sbit LCD_D5 at PORTD5_bit;
sbit LCD_D6 at PORTD6_bit;
sbit LCD_D7 at PORTD7_bit;
sbit LCD_RS_Direction at DDD0_bit;
sbit LCD_EN_Direction at DDD2_bit;
sbit LCD_D4_Direction at DDD4_bit;
sbit LCD_D5_Direction at DDD5_bit;
sbit LCD_D6_Direction at DDD6_bit;
sbit LCD_D7_Direction at DDD7_bit;
// End LCD module connections
char txt1] = "mikroElektronika";
char txt2] = "BigAVR2";
char txt3] = "Lcd4bit";
char txt4] = "example";
char i; // Loop variable
void Move_Delay() { // Function used for text moving
Delay_ms(500); // You can change the moving speed here
}
unsigned int adc_rd;
char txt[7];
void main(){
Lcd_Init(); // Initialize LCD
Lcd_Cmd(_LCD_CLEAR); // Clear display
Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off
while (1) {
adc_rd = ADC_Read(5); // get ADC value from 2nd channel
IntToStr(adc_rd, txt);
Lcd_Out(1,1,txt);
}
}
Kde dělám chybu? díky
administrator: přejmenováno z "Projekt v mikroC PRO for AVR"