s time da je na picu 16f84 izlaz bio na portu b. u čemu je problem?
Code:
#include <pic.h>
#include "delay.h"
__CONFIG(XT&PWRTEN&WDTDIS);
#define PORTBIT(adr,bit) ((unsigned)(&adr)*8+(bit))
static bit TS @ PORTBIT(PORTA,0);
static bit LED @ PORTBIT(PORTC,0);
void main(void){
unsigned int i;
TRISA=1;
ADCON1=6;
PORTA=0;
while(1)
{
DelayMs(1);
if(TS==0)
{
LED=1;
}
}
}
#include <pic.h>
#include "delay.h"
__CONFIG(XT&PWRTEN&WDTDIS);
#define PORTBIT(adr,bit) ((unsigned)(&adr)*8+(bit))
static bit TS @ PORTBIT(PORTA,0);
static bit LED @ PORTBIT(PORTC,0);
void main(void){
unsigned int i;
TRISA=1;
ADCON1=6;
PORTA=0;
while(1)
{
DelayMs(1);
if(TS==0)
{
LED=1;
}
}
}