Do you know how I can automatically centre a label in the exact centre of the screen?
Posts made by elettronico
-
Centre a label on M5Stack
-
RE: CAN BUS Error with M5Stack and COMMU Module
Solved with the code ;-)
message = com.commu_can_read_message(0)
hex_list = []
for b in message:
hex_str = hex(b)[2:]
if len(hex_str) < 2:
hex_str = '0' + hex_str
hex_list.append(hex_str) -
CAN BUS Error with M5Stack and COMMU Module
Hi, I send the command via canbus to the M5stack but receive a different message.
Example:
I send 00 00 00 D8 0D 06 01
I receive 00 00 00 D8 r 08 01It doesn't seem to like '0D' and sees it as CR
Is this a bug? Any ideas on how to fix it?
thank you!
-
RE: Int to Float conversion
@cognitive5525 said in Int to Float conversion:
A4 = int(A3, 16)
A5 = A3 /1000
label0.setText(str(A5))Thank you!
solved with this code:
A4 = int(A3, 16)
A5 = A4 /1000
label0.setText(str(A5)) -
RE: Int to Float conversion
thank you Cognitive5525, I have already tried but it does not work.
Here is the partial code:
A3 = (str((hex(A2)[2:] + hex(A1)[2:]))) A4 = (str(int(A3, 16))) // here all ok and the Label shows 10000 mV A5 = A4 / 1000 label0.setText(str(A5)) //the label shows nothing
-
Int to Float conversion
Hello, how can I convert an int value (10000 mV) from a variable to a float value in a Label block (10,000 V) ?
Thank you all for the help