I get into a function of the buttonclick but still the LED won't go on.
I connected the pin to the gate of a FET wich will turn on at a gate voltage of around 2,6V.
(When I connect 3,3V to the gate the LED does light up.)
This is the code I use:
Code: Select all
//--------------------- User code ---------------------//
bit label;
void InitIO()
{
//ADPCFG = 0xFFFF;
TRISB = 0x0000;
PORTB = 0xFFFF;
}
//----------------- End of User code ------------------//
// Event Handlers
void Button1Click() {
PORTB = PORTB || 0x0006;
//PORTB.B1 = 1;
strcpy(Label3.Caption, "Solenoid on");
DrawLabel(&Label3);
}
void Button2Click() {
InitIO();
}
I must have done something wrong in the code although I believe this is standard C.
Any help will be verry much appreciated!