sebalitter
Joined: 05 May 2015 Posts: 47
|
error 66 compile problem pointer |
Posted: Tue Aug 25, 2015 1:33 pm |
|
|
Hello there is an error in this code.
"*** Error 66 "main.c" Line 108(39,43): Previous identifier must be a pointer"
PIC18F46K20
MPLAB X 3.0v
CCS 4.130v
can you help me?
thanks!
Code: |
// defined(__PCH__)
//#include <18F452.h>
#include <18F46K20.h>
#include "string.h"
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=10000000)
//#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, BITS=8, PARITY = N,ERRORS, stream=PC)
//definiciones del Programa
#define LEDRojo1 PIN_A0 //anodo1 del led rojo
#define LEDRojo2 PIN_A1 //anodo2 del led rojo
#define LEDVerde1 PIN_C2 //anodo2 del led rojo
#define LEDVerde2 PIN_C3 //anodo2 del led rojo
#define SENSOR PIN_A2
#define FOTO PIN_E0 //RELE para la camara de fotos
#define k 0.022 //constante para cambio de unidades (Km/hora, M/seg, etc)
#define LOW 0
#define HIGH 1
#define INTS_PER_SECOND 10 // (10000000/(4*4*65536))
//funciones prototipo
byte Selecciona( char, int);
//Variables globales
char palabra[14];// = "PROMETEC.NET " ;
int num=0, len=0, fil=0;
float tiempo=1, medicion=0; //tiempo entre cada medicion. Debe ser menor o igual a 1 segundo
//long rise,fall,pulse_width,count=0;
byte F;
int seconds; // A running seconds counter
int int_count; // Number of interrupts left before a second has elapsed
const byte P[8] = { 0x78, 0x44, 0x44, 0x78, 0x40, 0x40, 0x40, 0x40 };
const byte R[8] = { 0x78, 0x44, 0x44, 0x78, 0x70, 0x58, 0x4C, 0x46 };
const byte O[8] = { 0x3C, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3C };
const byte M[8] = { 0x66, 0x7E, 0x5A, 0x42, 0x42, 0x42, 0x42, 0x42 };
const byte E[8] = { 0x7C, 0x40, 0x40, 0x78, 0x78, 0x40, 0x40, 0x7C };
const byte T[8] = { 0x7E, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18 };
const byte C[8] = { 0x7c, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x7C };
const byte N[8] = { 0x42, 0x62, 0x72, 0x5A, 0x4E, 0x46, 0x42, 0x42 };
const byte dot[8]={ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06 };
const byte sp[8]= { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
#int_timer1 // This function is called every time
// timer 1 overflows (65535->0), which is
void TIMER1_isr(void)
{ // approximately 19 times per second for
if(--int_count==0) { // this program.
++seconds;
int_count = INTS_PER_SECOND;
fil++;
}
}
void main(void)
{
SET_TRIS_B( 0xFF ); // pone B0, B1, B2 , B3 B4, B5, B6 y B7 como salidas
int_count = INTS_PER_SECOND;
setup_timer_1(T1_INTERNAL | T1_DIV_BY_4);
set_timer1(0);
enable_interrupts(INT_TIMER1);
enable_interrupts(GLOBAL);
strcpy(palabra,"TEMPOME ");
len = strlen(palabra); // Calcula la longitus de s
while(num < len)
{
F = Selecciona( palabra[num], fil);
output_B(F);
if(fil % 8 == 1)
num++;
}
}
byte Selecciona( char c, int fila)
{
if ( c == 'P') return( P[fila]) ;
if ( c == 'R') return( R[fila]) ;
if ( c == 'O') return( O[fila]);
if ( c == 'M') return( M[fila]);
if ( c == 'E') return( E[fila]);
if ( c == 'T') return( T[fila]);
if ( c == 'C') return( C[fila]); // problem
if ( c == 'N') return( N[fila]);
if ( c == '.') return( dot[fila]);
if ( c == ' ') return( sp[fila]);
}
|
Last edited by sebalitter on Tue Aug 25, 2015 2:06 pm; edited 1 time in total |
|