#pragma num_alias_table_entries 	14

IO_0 output bit ioLED1;
IO_1 output bit ioLED2;
IO_2 output bit ioLED3;

IO_4 input bit ioButton1;
IO_5 input bit ioButton2;
IO_6 input bit ioButton3;

network input SNVT_switch nviLED01;
network input SNVT_switch nviLED02;
network input SNVT_switch nviLED03;

network output SNVT_switch nvoValue01;
network output SNVT_switch nvoValue02;
network output SNVT_switch nvoValue03;


when(nv_update_occurs(nviLED01))
{
	io_out (ioLED1, (nviLED01.value && nviLED01.state));
}

when(nv_update_occurs(nviLED02))
{
	io_out (ioLED2, (nviLED02.value && nviLED02.state));
}

when(nv_update_occurs(nviLED03))
{
	io_out (ioLED3, (nviLED03.value && nviLED03.state));
}

when (io_changes(ioButton1))
{
	nvoValue01.state = !input_value;
	nvoValue01.value = nvoValue01.state ? (short) 200:0;
}

when (io_changes(ioButton2))
{
	nvoValue02.state = !input_value;
	nvoValue02.value = nvoValue02.state ? (short) 200:0;
}

when (io_changes(ioButton3))
{
	nvoValue03.state = !input_value;
	nvoValue03.value = nvoValue03.state ? (short) 200:0;
}

    Source: geocities.com/hk/cloud_fan_school/Program/Motor

               ( geocities.com/hk/cloud_fan_school/Program)                   ( geocities.com/hk/cloud_fan_school)                   ( geocities.com/hk)