Van der Waals
Member level 2
int_rb ccs
Hello all,
My code which consists on lightening a LED connected to RA3 with a push-button connected to RB6 was compiled with success (0 error , 2 warnings of conditions always true and false) but did no function when I tried to simulate it with ISIS however it was a simple one (see below),
would anybody help me in correcting it or give me another correct code written with the same compiler ?
thanks in advance.
I use PCW 4.057 version of CCS.
Hello all,
My code which consists on lightening a LED connected to RA3 with a push-button connected to RB6 was compiled with success (0 error , 2 warnings of conditions always true and false) but did no function when I tried to simulate it with ISIS however it was a simple one (see below),
would anybody help me in correcting it or give me another correct code written with the same compiler ?
thanks in advance.
I use PCW 4.057 version of CCS.
Code:
#include "C:\Documents and Settings\test 1.h"
#ZERO_RAM
#define RB6 PIN_B6
int1 flag6;
#int_RB
void RB_isr()
{
if (!RB6) flag6=1;
delay_ms(300);
}
void main()
{
port_b_pullups(TRUE);
setup_adc_ports(NO_ANALOGS);
setup_adc(ADC_OFF);
setup_spi(FALSE);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_8);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
ext_int_edge(H_TO_L);
enable_interrupts(INT_EXT);
enable_interrupts(INT_RB);
enable_interrupts(GLOBAL);
set_tris_b(0xff);
set_tris_a(0x00);
flag6=0;
while(1)
{
if (flag6)
{
output_high(pin_a3);
flag6=0;
}
}
}