Try this extension
https://marketplace.visualstudio.com/items?itemName=curdeveryday.vscode-m5stack-mpy
Posts made by robalstona
-
RE: Micropython and C++
No you cannot. The term firmware in this case can be a bit misleading. It is compiled code of micropython interpreter written in c/c++ language with implemented support for uploading or running python scripts via uiflow online editor or usb connection. you might as well call a c/c++ program compiled and uploaded using arduino a firmware.
-
RE: StickC USB support for external USB Memory stick
No you cannot, between usb and esp is a usb-uart conwerter. Its allow only to serial communication.
-
RE: Getting Microphone Data (decibels) from M5StickC Plus or AtomU
You cannot read data from this microphone via analog read. This microphone is digital and has two digital pins. One of them is clock signal (probably connected to gpio0) which you should drive with 1MHz signal. Second is digital output which give a signal similiar to pwm signal (pulse density modulation) . So only walues which you read are 0V or 3.3V.
-
RE: Another UIFlow 2.0 Suggestion
In my opinion should be a button or menu entry to export blocky program as jpg/png image.
-
RE: Analog Read gives wrong value.
The adc readings is non linear at both ends of range (flat). So you can't measure voltage below ~0.17V and under ~3.15.
Below is link with explain
https://randomnerdtutorials.com/esp32-adc-analog-read-arduino-ide/ -
RE: Ways to add external battery
In yoir case the best option is a connect externall battery to gnd and vbat on hat port and remove internall battery. But opening m5stick withoit damage internal connection is some difficult. I opened it once to remove magnets and i dont doing this again. Axp is settings default to charge battery with 100mA current, so if you connect bigger capacity battery it will default charge in longer time ( it is safe for battery).
I saw command in uiflow to change axp charge current to predefined values, but i dont test it if this change is permament or you need change this everyvrestartvof device. -
RE: How to distribute Micropython application as binary flash image ?
You can use esp flash tool
https://github.com/espressif/esptoolBut it is a command line tool. and need python installed on your pc to work. With this tool you can download whole spiflash content to one bin file. You can also flash it back with this tool.
I don't use M5burner which probably don't have option to burn custom bin file. By the way, M5burner use esptool in background to flash their firmwares.
-
RE: Guidance on running multiple programs
Programs on the device are saved in two files
program_name.m5b (used only by uiflow to put the project back into the editor)
program_name.py (generated python code based on your project in uiflow). This file is run on the target device.You can use the import program_name.py statement in your program in the execute block. Then it will be loaded and run.
But this method has its drawbacks, because the initialization instructions at the beginning of the program will be reloaded. You have to be careful what variable names you use, so that you don't overwrite the variable values with new ones from the imported file.
The import statement imports the code the first time and runs it, subsequent imports of the same file just load it into memory without running it (you can find a solution to this problem on google.
Ewentually you could edit your python code before upload to device with this way to solve above problemdef main(): # place whole generated python # file in this function with # proper intend main()
-
RE: M5 atom lite connector.
Probably the grove name is property of seedstudio, so m5stack don't use this in description.
-
RE: M5 atom lite connector.
This connector type is used by seeedstudio and they called it grove
-
RE: Waterproof temperature probe
Ewentually try this code with your lm35 to check of works (i tested my lm35 sensor with it)
-
RE: Waterproof temperature probe
Lm35 works like a regulated voltage source with 10mV step/°C. So if you measure 20°C sensor set this output to 0.20V. Analogically for 23°C this output will set to 0.23V.There is to small voltage change for this line lenght (line resistance, electric hum and too small output current). Second reason is builtin adc its non linear below ~0.16-0.17V so minimal temperature i can read with this sensor oscilate around 13-14°C and adc reading don't go below this. Ewentually you could use similiar sensor tmp36 where output voltage for 0°C starts from 0.5V with 10mV step/°C. But these sensors works good only in short distances counting in centimeters.
-
RE: Waterproof temperature probe
You can use ds18b20 it's ideal for your distance, but it is a digital sensor. So if you want read temperatire from him you must find a library to use them.
I create simple custom block for uiflow to read temperature from this sensor, but it's limited to read temperature from only one sensor connected to gpio pin. You must remember to connect a additional pullup resistor betwen vcc and out pin of sensor (see ds18b20 datasheet for connection and proper values of this resistor).
https://github.com/stonatm/UiFlow-custom-blocks/tree/master/ds18b20
-
RE: How do I get the exception details in UIFlow?
try: # some code except Exception as e # print to serial console print( str(e) ) # or store in variable
If you connect device trought usb, you could see all output in serial terminal.
-
RE: How do I access the mic on the m5stickc?
Hi is spent a long time to find how use PDM microphone in m5stickC and finally i pass. I find some code thats should work, but its not working.
from machine import I2S, Pin mic = I2S(I2S.NUM0, ws=Pin(0), sdin=Pin(34), mode=I2S.MASTER_PDW, dataformat=I2S.B16, channelformat=I2S.ONLY_RIGHT, samplerate=16000, dmacount=16, dmalen=256) buffer = bytearray(7168) while True: # read data into buffer mic.readinto(buffer) # do something with data stored in buffer # mic.deinit()
-
RE: uiflow execute code
There is a bug in uiflow execute block. When you click to edit text of this block, there is a one space before cursor. With this space your code throw bad intendent error. Simply press backspace before write your code to delete this space.
-
RE: UIFlow - Trimming Strings
Try change name of function or variable. At now they had the same names.
Maybe this construction will be work
str(${Trimmer})[1:-1]
-
RE: UIFlow - Trimming Strings
@notdodgy
In python this also worksout_str = in_str[1:-1]
-
RE: UIFlow - Trimming Strings
@notdodgy, show me example input string, and write what exactly you need "extract" from this json string. Show me what string you except as output according to example input string. It is a some kind of homework?. I don't know why you make so many character substitutions in the text.
in python code you could use this construction:
out_str = in_str.replace('[', '').replace(']', '').replace...
but i dont tested yet how long may be replace chain.