unsigned long segundo=0, dim=0, diml=8;
while(1){
if(dim==0){
GPIO = 0b001001;
__delay_ms(dim);.......
.........................#include <stdio.h>
#include <xc.h>
#include <stdint.h> /* For uint8_t definition */
#include <stdbool.h>
#pragma config OSC = IntRC // Oscillator Selection bits (internal RC oscillator)
#pragma config WDT = OFF // Watchdog Timer Enable bit (WDT disabled)
#pragma config CP = OFF // Code Protection bit (Code protection off)
#pragma config MCLRE = OFF // GP3/MCLR Pin Function Select bit (GP3/MCLR pin function is digital input, MCLR internally tied to VDD)
// #pragma config statements should precede project file includes.
// Use project enums instead of #define for ON and OFF.
#define _XTAL_FREQ 4000000
int segundo=0,dim=0,diml=8;
void main(void) {
TRISGPIO = 0b001000;
GPIO = 0b001000;
while(1)
{
if(segundo>60){
segundo=0,dim++,diml--;
}
if(dim==8){
dim=0,diml=8;
}
GPIO = 0b001001;
__delay_ms(dim);
GPIO = 0;
__delay_ms(diml);
segundo++;
}
}podrias poner el error ?
This is an inline function that is expanded by the code generator. When called, this routine expands to an inline assembly delay sequence
#pragma config OSC = IntRC // Oscillator Selection bits (internal RC oscillator)
#pragma config WDT = OFF // Watchdog Timer Enable bit (WDT disabled)
#pragma config CP = OFF // Code Protection bit (Code protection off)
#pragma config MCLRE = OFF // GP3/MCLR Pin Function Select bit (GP3/MCLR pin function is digital input, MCLR internally tied to VDD)
// #pragma config statements should precede project file includes.
// Use project enums instead of #define for ON and OFF.
#include <xc.h>
#define _XTAL_FREQ 4000000
void delayMS(unsigned int tiempo)
{
unsigned int i;
for(i=0; i< tiempo;i++)
{
__delay_ms(1);
}
}
void main(void) {
TRISGPIO = 0x00;
GPIO=0x00;
int j=100, m=30;
while(1){
GPIO = 0x01;
delayMS(j);
GPIO=0x00;
delayMS(m);
}
return;
}