{"action":"opened","issue":{"url":"https://api.github.com/repos/dcs-bios/dcs-bios/issues/83","repository_url":"https://api.github.com/repos/dcs-bios/dcs-bios","labels_url":"https://api.github.com/repos/dcs-bios/dcs-bios/issues/83/labels{/name}","comments_url":"https://api.github.com/repos/dcs-bios/dcs-bios/issues/83/comments","events_url":"https://api.github.com/repos/dcs-bios/dcs-bios/issues/83/events","html_url":"https://github.com/dcs-bios/dcs-bios/issues/83","id":137543063,"number":83,"title":"Caution Panel goes \"beserk\"","user":{"login":"Themorg62","id":17567332,"avatar_url":"https://avatars.githubusercontent.com/u/17567332?v=3","gravatar_id":"","url":"https://api.github.com/users/Themorg62","html_url":"https://github.com/Themorg62","followers_url":"https://api.github.com/users/Themorg62/followers","following_url":"https://api.github.com/users/Themorg62/following{/other_user}","gists_url":"https://api.github.com/users/Themorg62/gists{/gist_id}","starred_url":"https://api.github.com/users/Themorg62/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Themorg62/subscriptions","organizations_url":"https://api.github.com/users/Themorg62/orgs","repos_url":"https://api.github.com/users/Themorg62/repos","events_url":"https://api.github.com/users/Themorg62/events{/privacy}","received_events_url":"https://api.github.com/users/Themorg62/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-01T11:09:19Z","updated_at":"2016-03-01T11:09:19Z","closed_at":null,"body":"Hi guys,\r\n\r\nMy caution panel leds light up when the plane starts moving. Everything works fine while not moving.\r\n\r\nI have the latest arduino library installed and no exports other than DCSBios\r\n\r\nCan someone help me figuring that out ?\r\n\r\nMy arduino script in a Arduino Mega:\r\n\r\n#include <DcsBios.h>\r\n#include <Servo.h>\r\n\r\n/* Instantiate a ProtocolParser object to parse the DCS-BIOS export stream */\r\nDcsBios::ProtocolParser parser;\r\n\r\n/* Declare a Master Caution Reset button on pin 10\r\nDcsBios::Switch2Pos masterCautionBtn(\"UFC_MASTER_CAUTION\", 10);\r\n/* Make the LED connected to pin 13 into a Master Caution Light */\r\nDcsBios::LED clA1(0x10d4, 0x0001, 2);\r\nDcsBios::LED clA2(0x10d4, 0x0002, 3);\r\nDcsBios::LED clA3(0x10d4, 0x0004, 4);\r\nDcsBios::LED clA4(0x10d4, 0x0008, 5);\r\nDcsBios::LED clB1(0x10d4, 0x0010, 6);\r\nDcsBios::LED clB2(0x10d4, 0x0020, 7);\r\nDcsBios::LED clB3(0x10d4, 0x0040, 8);\r\nDcsBios::LED clB4(0x10d4, 0x0080, 9);\r\nDcsBios::LED clC1(0x10d4, 0x0100, 10);\r\nDcsBios::LED clC2(0x10d4, 0x0200, 11);\r\nDcsBios::LED clC3(0x10d4, 0x0400, 12);\r\nDcsBios::LED clC4(0x10d4, 0x0800, 14);\r\nDcsBios::LED clD1(0x10d4, 0x1000, 15);\r\nDcsBios::LED clD2(0x10d4, 0x2000, 16);\r\nDcsBios::LED clD3(0x10d4, 0x4000, 17);\r\nDcsBios::LED clD4(0x10d4, 0x8000, 18);\r\nDcsBios::LED clE1(0x10d6, 0x0001, 19);\r\nDcsBios::LED clE2(0x10d6, 0x0002, 20);\r\nDcsBios::LED clE3(0x10d6, 0x0004, 21);\r\nDcsBios::LED clE4(0x10d6, 0x0008, 22);\r\nDcsBios::LED clF1(0x10d6, 0x0010, 23);\r\nDcsBios::LED clF2(0x10d6, 0x0020, 24);\r\nDcsBios::LED clF3(0x10d6, 0x0040, 25);\r\nDcsBios::LED clF4(0x10d6, 0x0080, 26);\r\nDcsBios::LED clG1(0x10d6, 0x0100, 27);\r\nDcsBios::LED clG2(0x10d6, 0x0200, 28);\r\nDcsBios::LED clG3(0x10d6, 0x0400, 29);\r\nDcsBios::LED clG4(0x10d6, 0x0800, 30);\r\nDcsBios::LED clH1(0x10d6, 0x1000, 31);\r\nDcsBios::LED clH2(0x10d6, 0x2000, 32);\r\nDcsBios::LED clH3(0x10d6, 0x4000, 33);\r\nDcsBios::LED clH4(0x10d6, 0x8000, 34);\r\nDcsBios::LED clI1(0x10d8, 0x0001, 35);\r\nDcsBios::LED clI2(0x10d8, 0x0002, 36);\r\nDcsBios::LED clI3(0x10d8, 0x0004, 37);\r\nDcsBios::LED clI4(0x10d8, 0x0008, 38);\r\nDcsBios::LED clJ1(0x10d8, 0x0010, 39);\r\nDcsBios::LED clJ2(0x10d8, 0x0020, 40);\r\nDcsBios::LED clJ3(0x10d8, 0x0040, 41);\r\nDcsBios::LED clJ4(0x10d8, 0x0080, 42);\r\nDcsBios::LED clK1(0x10d8, 0x0100, 43);\r\nDcsBios::LED clK2(0x10d8, 0x0200, 44);\r\nDcsBios::LED clK3(0x10d8, 0x0400, 45);\r\nDcsBios::LED clK4(0x10d8, 0x0800, 46);\r\nDcsBios::LED clL1(0x10d8, 0x1000, 47);\r\nDcsBios::LED clL2(0x10d8, 0x2000, 48);\r\nDcsBios::LED clL3(0x10d8, 0x4000, 49);\r\nDcsBios::LED clL4(0x10d8, 0x8000, 50);\r\n\r\nvoid setup() {\r\n  Serial.begin(500000);\r\n\r\n}\r\n\r\n\r\n/*\r\nYour main loop needs to pass data from the DCS-BIOS export\r\nstream to the parser object you instantiated above.\r\n\r\nIt also needs to call DcsBios::PollingInput::pollInputs()\r\nto detect changes in the state of connected controls and\r\npass them on to DCS.\r\n*/\r\nvoid loop() {\r\n  // feed incoming data to the parser\r\n  while (Serial.available()) {\r\n      parser.processChar(Serial.read());\r\n  }\r\n  \r\n  // poll inputs\r\n  DcsBios::PollingInput::pollInputs();\r\n}\r\n\r\n/*\r\nYou need to define\r\nvoid sendDcsBiosMessage(const char* msg, const char* arg)\r\nso that the string msg, followed by a space, the string arg\r\nand a newline gets sent to the DCS-BIOS import stream.\r\n\r\nIn this example we send it to the serial port, so you need to\r\nrun socat to read the data from the serial port and send it\r\nover UDP to DCS-BIOS.\r\n\r\nIf you are using an Ethernet Shield, you would probably want\r\nto send a UDP packet from this subroutine.\r\n*/\r\nvoid sendDcsBiosMessage(const char* msg, const char* arg) {\r\n  Serial.write(msg);\r\n  Serial.write(' ');\r\n  Serial.write(arg);\r\n  Serial.write('\\n');\r\n}\r\n\r\n/*\r\nThis subroutine gets called every time a write access is received\r\nfrom the export stream (you need to define it even if it\r\ndoes nothing).\r\n\r\nUse this to handle outputs which are not covered by the\r\nDcsBios Arduino library (e.g. displays).\r\n*/\r\nvoid onDcsBiosWrite(unsigned int address, unsigned int value) {\r\n  \r\n}"}}