Beruflich Dokumente
Kultur Dokumente
port_a
port_b
port_c
port_d
port_e
=
=
=
=
=
0xf80
0xf81
0xf82
0xf83
0xf84
//
// RAM, RAM, RAM
//
////////////////////////////////////////////////////////////////////////////////
///////////////////
char Version[] = "RADAMIS";
int8 recbuf[Lenbuf];
int8 sndbuf[Lenbuf];
////////////////////////////////////////////////////////////////////////////////
///////////////////
//
// M A I N
//
////////////////////////////////////////////////////////////////////////////////
///////////////////
void antirebote();
void main(void) {
int adc0[];
int i,j,k;
char voltage[9];
setup_adc_ports(AN0|VSS_VDD);//para escoger el canal cero y el vss y vdd
SETUP_ADC(ADC_CLOCK_INTERNAL);//la frecuencia de muestreo es 2-6us
SET_ADC_CHANNEL(0);
delay_ms(500);
usb_init();
usb_task();
usb_wait_for_enumeration();
disable_interrupts(global);
port_d=0;
i=0;
j=0;
k=0;
while (TRUE){
if (uno == 0 && i==0)
{
antirebote();
i=1;
bit_set(port_b,6);
}
if (uno == 0 && i==1)
{
antirebote();
i=0;
bit_clear(port_b,6);
}
if (dos == 0 && j==0)
{
antirebote();
j=1;
bit_set(port_b,5);
}