Are these the correct packets for turning F0 (headlight) on/off?
Headlight 0n (F0) 111111111111 0 00000011 0 10010000 0 1Headlight 0ff (F0) 111111111111 0 00000011 0 10000000 0 1
This is regardless of what speed the train is traveling - correct?
I believe this is correct, assuming an active primary address of '3' and 28/128 speed step bit of CV29 (bit 1) set, except that you do not have the error detection byte. Also, your pre-amble (the first 12 1's) should be at least 14 bits. Decoders are supposed to require no more than 12, but the spec states that the command station should send at least 14.
nOt sure how you are trying to use this, but if you are trying to build your own command station, ideally it should have a packet send routine that takes care of the housekeeping stuff such as the preamble and error detection calculation so you would feed is just the actual packet information and not have to worry about adding that each time. Rough pseudocode:
senddccpacket(packet)
checksum = calcchecksum(packet)
output = preamble & packet & checkum
dccout(output)
--Randy
Modeling the Reading Railroad in the 1950's
Visit my web site at www.readingeastpenn.com for construction updates, DCC Info, and more.
The preamble and error check are managed. I was just asking about my syntax on the packet to make sure its correct. Thanks.