Closed Lynnmike closed 7 months ago
Hi @Lynnmike! I need some more information to understand what you're trying to do. There is an example script transmit_ev1527.py
that shows how to use this API. It does not support the use of byte array. Also I'm not sure what kind of data we're looking at since a code usually consists of just some bits (e.g. the EV1527 uses a 24 bit code word). How did you retrieve this data? What chipset do you use?
Thanks for reply,I use esp8266 and 315mhz module to do that by using arduino it worked good .then I turn to micropython without changing physical connection between 315mhz module and esp8266
so how could trun 7720776 into the data that you used in your example 'transmitter.send(data, 24)'
Thanks bro ,I made it
@Lynnmike Glad to hear. How did you solve it? For integer values you need to specify the amount of bits e.g. transmitter.send(3856226, 24) # Send as integer (24 bit)
. Was that the problem?
transmitter = Transmitter(pin=5,pulse_width_us=288) # Transmitter connected to pin D2 transmitter.send("11101011100111101001000") # Send 24bit code retrieved from remote control when i turn 7720776 to binary,the first 0(left to right) in binary is missing cause only 23 bit to send,so i just add 0 . one issue is i set pulse as 288,but the pulse the reciver actually got is 246,i just change 288 to 330
array('I', [257, 857, 641, 481, 645, 428, 641, 476, 267, 801, 641, 476, 268, 854, 637, 481, 641, 422, 641, 748, 267, 850, 320, 908, 690, 481, 641, 422, 641, 481, 641, 423, 267, 908, 636, 428, 214, 903, 267, 802, 641, 476, 267, 855, 263, 800, 268, 850, 267]) bytearray(b'\x00\x01\x01\x01\x01\x01\x01\x01\x00\x01\x01\x01\x00\x01\x01\x01\x01\x01\x01\x01\x00\x01\x00\x01\x01\x01\x01\x01\x01\x01\x01\x01\x00\x01\x01\x01\x00\x01\x00\x01\x01\x01\x00\x01\x00\x01\x00\x01\x00')
array('I', [371, 1172, 917, 588, 961, 530, 961, 588, 369, 1121, 961, 583, 321, 1121, 961, 639, 921, 534, 957, 587, 321, 1116, 375, 1121, 961, 583, 961, 535, 903, 587, 961, 583, 321, 1179, 982, 485, 375, 1174, 369, 1122, 961, 582, 321, 1121, 375, 1116, 374, 1175, 316]) bytearray(b'\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x00\x01\x01\x01\x01\x01\x01\x01\x00\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x00\x01\x01\x01\x01\x01\x01\x01\x01\x01\x00\x01\x01\x01\x01\x01\x00')
these 2 array