You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#define _XTAL_FREQ 4000000 //4 mhz, la capacidad maxima es de 20mhz
#include <xc.h>
#include "newxc8_header.h"
void main(void)
{
TRISBbits.TRISB0 = 0; // Configuramos RB0 como Salida digital /Tal vez a un LED antes que a un LCD/
TRISAbits.TRISA0 = 1; // Configuramos RA0 como Entrada digital /pulso sensor/ este va a funcionar como entrada digital ya que cuando sense va a ser 1(true) y cuando no va a ser 0(false)
PORTBbits.RB0 = 0; // Es para mantener RB0 apagado, posible trash, se planea eliminar en un futuro
while (PORTAbits.RA0 == 1)
{
PORTBbits.RB0 = 1; // Activa salida digital RB0 /Prende el LED/
__delay_ms(1000);
PORTBbits.RB0 = 0; // Apaga salida digital RB0 /Apaga el LED/