Our friend MUST discover some little things by experience ...
Copy and paste is really the worst solution !!!
He surely forgot that !!!
Alain
Our friend MUST discover some little things by experience ...
Copy and paste is really the worst solution !!!
He surely forgot that !!!
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
I am new to the forum and hope not out of line...
Clues:
"The LED brightens" (unintentionally) does not sound very digital.Originally Posted by Malcolm
Thanks, and yes it compiles OK and in tests works as required approx 70% (ie 7 out of 10) of the time. On three attepts LED2 remained lit, but its a lot better than my 0% success rateI wonder if there might be an interaction between the magnetics of the locomotive "engine" and the reed switch. Possible even modulating the switch as the loaded motor slowly passes over the switch. Monster size "contact bounce". Or perhaps the magnetics of the motor offsets the permanent magnet, causing it to not always trigger the reed switch.I hooked up a test track and placed a magnet on a loco to see how it worked, as I had been using magnets passing over the switches by hand to test the code.
I don't know if it's due to the speed of the train (slower than my hand tests) but I got a 1 in 10 success rate of both LEDs being turned off when the train exited the siding
If this is part of the problem then Melanie's suggestion would certainly apply:
Don't forget the sequence of permanent magnet and motor chatter would depend upon the direction of travel (just to make it interesting).Originally Posted by Melanie
This may not be any part of Malcolm's problem but something we should keep in mind when using reed switches or hall effect devices. Don't ask why I thought of it.
This forum is the most useful resource, for beginners, on the entire web. Thanks to all you PIC gurus, most of the "gotchas" with PICs, can be found with a forum search. Thanks for all your hard work.
-Adam-
Bookmarks