Can msg send

This commit is contained in:
2021-07-02 16:13:59 +03:00
parent f9368c434b
commit 88c6b06061
8 changed files with 90 additions and 25 deletions

View File

@@ -1,13 +1,15 @@
import kx
import can
import protocol_kx
import struct
import os
import time
can0 = can.interface.Bus(bustype='socketcan', channel='can0', bitrate=500000)
KXLOX = kx.KX(protocol_kx.KDescription.K_TEST_SOURCE_2_SIGLVL.value, 950, 255, can0)
KXLOX.KXInit(protocol_kx.KDescription.K_SBL_ID.value, 43)
KXLOX.KXInit(protocol_kx.KDescription.K_TEST_SOURCE_1_POS_X_MAX.value, 21)
KXLOX.KXInit(protocol_kx.KDescription.K_TEST_SOURCE_1_POS_Y_MAX.value, 21)
KXLOX.KXInit(protocol_kx.KDescription.K_TEST_SOURCE_1_POS_X_MIN.value, 1)
@@ -18,5 +20,6 @@ KXLOX.KXInit(protocol_kx.KDescription.K_TEST_SOURCE_1_SIGLVL.value, 450)
KXLOX.KXInit(protocol_kx.KDescription.K_TEST_SOURCES_ENABLED.value, 1)
KXLOX.sendK()
KXLOX.writeToFlashK()
os.wait(100)
time.sleep(0.1)
KXLOX.reset()