what's your M5 device?
Posts made by dawncold
-
so exicted to verify the IR unit is working on AtomLite
I think I have spent hours to hours to verify the IR unit, it keeps not working as expected on UIFlow and MicroPython, but tonight I tried Arduino, althrough I can not pronounce it correctly and can not remember the weird name, it shows to me the IR unit can receive single from a fan remote!!!
I want to share the working code here
Notes: this example code is copied from here, and it's target to M5Stack instead of M5Atom, so the default RECV PIN is 36, but for the M5Atom, you should use 32 as the default RECV PIN, the default means connecting IR unit via the HY2.0-4P cable.
#include <M5Stack.h> int ir_recv_pin = 32; int ir_send_pin = 26; int last_recv_value = 0; int cur_recv_value = 0; void setup() { M5.begin(); M5.Power.begin(); pinMode(ir_recv_pin, INPUT); pinMode(ir_send_pin, OUTPUT); digitalWrite(ir_send_pin, 1); } void loop() { cur_recv_value = digitalRead(ir_recv_pin); if (last_recv_value != cur_recv_value) { if (cur_recv_value == 0) { // 0: detected 1: not detected Serial.println("detected"); } last_recv_value = cur_recv_value; } Serial.println(cur_recv_value); }
-
RE: IR(NEC) address [] data [] what are the expected values?
Hi I tried many times with the IR unit and uiflow, I think the uiflow can do nothing with IR unit.
What I get is the IR unit can only receive what it send out, you can write some very simple python codes to validate this, if you have connected the controller with serial,
ir_0 = unit.get(unit.IR_NEC, unit.PORTA) ir_0.rx_cb(lambda d,a,c: print("recv:",d,a,c)) # same with ir.tx(123,456) ir_0.tx(123,456)
You should get the output something like that, "recv: 255 123 0", you can try to hide the transmitter or receiver light for a while if you don't get the "recv", and try another times.
I think the implementation for rx_cb is quiet simple and it can not be used for parse the output of any remotes, I'm trying to learn something Arduino or the .Net, don't touch uiflow any more.
-
[Solution] connect 2 RGB unit
import unit rgb3 = unit.get(unit.RGB, unit.PORTA) # set 1-3 rgb in first RGB unit rgb3.setColor(1, 0xffffff) rgb3.setColor(2, 0xffffff) rgb3.setColor(3, 0xffffff) # set 4-6 rgb in second RGB unit rgb3.setColor(4, 0xffffff) rgb3.setColor(5, 0xffffff) rgb3.setColor(6, 0xffffff) # if you have three or more RGB unit, # you can use 7, 8, 9 as the number
-
Does anybody try to convert Atom S3 as a keyboard?
I found somebody want the usb-hid support, and esp32 does not support well for usb-hid, but esp32-s3 should support that native, is there any document for usb-hid?