mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
JS: Improve and fix subghz module
- Fix some memory leaks - Check for setup() being called - Add end(), can setup() again to check for external module - Add support for custom modulation presets - Improve error handling - Deinit correctly at exit - Fix RAW files - Fix repeat behavior, can specify with transmitFile(path, repeat)
This commit is contained in:
@@ -29,9 +29,17 @@ changeFrequency(433920000);
|
||||
printRXline();
|
||||
delay(1000);
|
||||
|
||||
let result = subghz.transmitFile("/ext/subghz/0.sub");
|
||||
print(result ? "Send success" : "Send failed");
|
||||
print("Sending 0.sub")
|
||||
subghz.transmitFile("/ext/subghz/0.sub");
|
||||
// Can also specify repeat count: subghz.transmitFile(path, repeat)
|
||||
// If not provided, defaults to 1 repeat for RAW and 10 repeats for parsed
|
||||
// These 10 repeats by default are to simulate holding the button on remote
|
||||
print("Send success");
|
||||
delay(1000);
|
||||
|
||||
changeFrequency(315000000);
|
||||
printRXline();
|
||||
printRXline();
|
||||
|
||||
// Optional, done automatically at script end
|
||||
subghz.end()
|
||||
// But can be used to setup again, which will retry to detect external modules
|
||||
Reference in New Issue
Block a user