The line input led1 is actually input sw1
The line input led1 is actually input sw1
Is SW1 the SW1 on the LAB-XUSB board? (the matrix keypad)
If so, then you need to turn ON the internal pull-ups on PORTB.
And PORTB.4 is the input. Set PORTB.0 LOW.
See the keypad pinouts in the LAB-XUSB schematic ... http://melabs.com/downloads/LABXUSCH_06.PDF
DT
Hi Darrel,
Yes it is that switch. The idea was to have pull-ups off, use portb.4 as the supply, b3, & b5 as the encoder inputs, with the 100k weak pull-down resistors, and sw1 as the input when I push on the encoder shaft. I can't see why this does not work with the pull ups off.
Oh well, back to the drawing board. Thanks.
Bob.
RB0 doesn't have a 100k pull-down resistor, only RB3 and RB5 do.
DT
Maybe I need to add a pull down to B0 too, though I still cant explain the strange results I was getting.
Anyway thank you for your help, I'll have another go at the weekend.
Hope I can get it to work, I love how fitting an encoder to the board made it an encoder with push button switch underneath, so just pushing the knob gives me an encoder with a switch, totally by accident, not design.
Amazing, & puzzling how I can write a USB interface, write the visual basic program to connect the hardware to flight simulator, and then I cant even get a switch to work.
By the way much kudos, & many thanks for your interrupt routines, they made a project at work really easy for me.
Kind regards
Bob...
Bookmarks