Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 19:ff21ba3a4dc5
- Parent:
- 17:0a657e338356
- Child:
- 20:608ab9bf340d
--- a/main.cpp Thu Jun 07 12:20:12 2018 +0000 +++ b/main.cpp Thu Jun 07 12:54:59 2018 +0000 @@ -172,6 +172,26 @@ DCC_send_command(DCCaddress,DCC_func_lighton,200); //light full again led2 = 1; + //Command variables for Switches using DCC + + unsigned int SWBaddress = 0x06; //address for switch box + + ////100DDDDD where DDDDD + ///00001 to flip the first switch SW1 (F1 active) + ///00010 to flip the second switch SW2 (F2 active) + ///00100 to flip the third switch SW3 (F3 active) + ///01000 to flip the fourth switch SW4 (F4 active) + //example - 111111 0 00000101 0 10000000 0 10000101 1 - idle + + unsigned int SWBflip_idle = 0x80; //No switches -- idle + unsigned int SWBflip_f1 = 0x81; //FLIP 1 + unsigned int SWBflip_f2 = 0x82; + unsigned int SWBflip_f3 = 0x84; + unsigned int SWBflip_f4 = 0x90; + + //Send using DCC_send_command() + + //Demo for stopping at the station while(1) {