Search found 141 matches

by liudr
Wed Dec 19, 2018 7:22 pm
Forum: General Discussion and Questions
Topic: New user with questions about documentation
Replies: 2
Views: 162

Re: New user with questions about documentation

Hi, I agree with you that the ADC should be documented. The name analog-to-digital-converter really means nothing to those not knowing what it does. I'd rather call it voltage input. The 0-4095 to 0-3.3V mapping should probably be mentioned in the doc. The 3.3V supply may not be exactly 3.3V. If you...
by liudr
Mon Sep 10, 2018 9:48 pm
Forum: ESP32 boards
Topic: Serial port multiplexing
Replies: 3
Views: 283

Re: Serial port multiplexing

Thanks! I was able to understand the code, which uses uart_set_pin() to set pins. I couldn't find uart_set_pin() in the repo. Could you help? Anyway, it doesn't seem to handle past pins, such as setting them to I or T with pull-down. I guess I'll have to do that myself right before switching the pin...
by liudr
Mon Sep 10, 2018 4:49 am
Forum: ESP32 boards
Topic: Serial port multiplexing
Replies: 3
Views: 283

Serial port multiplexing

I am thinking about this scenario where I need more than 2 serial ports, (not gonna touch the one running REPL). I've done this on a dev board, activate a serial port with machine.UART() one a pair of pins. Then activate the port on another two pins. It works. However, I'm trying to do it safely. Wh...
by liudr
Mon Sep 10, 2018 4:41 am
Forum: ESP32 boards
Topic: how to receive integer from uart 1
Replies: 3
Views: 284

Re: how to receive integer from uart 1

I usually implement an end-of-message character and send my numbers by plain ASCII string. This way I can more easily decode the message. Another thing you can try is to use json format (still send it in with an end-of-message character such as \n). On PC side, use json module to serialize your data...
by liudr
Mon Sep 10, 2018 4:15 am
Forum: ESP32 boards
Topic: changing GPIO36 pins as INPUT or OUTPUT
Replies: 5
Views: 324

Re: changing GPIO36 pins as INPUT or OUTPUT

Not only is GPIO36 an input-only pin, it also does NOT feature pull-up/down resistors: Note 2 The following pins are input-only. These pins do not feature an output driver or internal pull-up/pull-down circuitry: SENSOR_VP (GPIO36), SENSOR_CAPP (GPIO37), SENSOR_CAPN (GPIO38), SENSOR_VN (GPIO39), VDE...
by liudr
Mon Sep 10, 2018 4:07 am
Forum: ESP32 boards
Topic: Esp32 & micropython connect to console via wlan
Replies: 4
Views: 475

Re: Esp32 & micropython connect to console via wlan

I am running a fork of the official firmware by loboris. The firmware has FTP server and Telnet server. If you set them up in main.py you can get remote access through Telnet (same as REPL) and upload files with FTP, simultaneously.

https://github.com/loboris/MicroPython_ ... _LoBo/wiki
by liudr
Mon Aug 20, 2018 4:49 pm
Forum: General Discussion and Questions
Topic: Need some help how to distribute features between main.py and scripts on sd card
Replies: 13
Views: 1050

Re: Need some help how to distribute features between main.py and scripts on sd card

No. Have the module with the logging function run import os This forum is to support MicroPython: users assume a knowledge of Python. Your queries are elementary ones about the Python language. I would advise you to learn the language using Python on a PC with a book or online course. That was the ...
by liudr
Sun Aug 19, 2018 9:45 pm
Forum: General Discussion and Questions
Topic: Need some help how to distribute features between main.py and scripts on sd card
Replies: 13
Views: 1050

Re: Need some help how to distribute features between main.py and scripts on sd card

...Since you don’t have great control over when a module runs (at first import), it typically shouldn’t do anything else than define functions and classes, and possibly initialize some things. Any code that needs to run at a determined time should be inside those functions and classes. I got it now...
by liudr
Sun Aug 19, 2018 9:43 pm
Forum: General Discussion and Questions
Topic: Need some help how to distribute features between main.py and scripts on sd card
Replies: 13
Views: 1050

Re: Duck Typing

Python uses Duck Typing . It is normal to do things like: import machine i2c = machine.I2C(1) import my_module my_module.run(i2c) my_module only needs to import machine if "machine" appears in its sourcecode. The module can feely call I2C methods against the passed I2C instance: Python determines t...
by liudr
Sun Aug 19, 2018 5:05 pm
Forum: General Discussion and Questions
Topic: Need some help how to distribute features between main.py and scripts on sd card
Replies: 13
Views: 1050

Re: Need some help how to distribute features between main.py and scripts on sd card

I am mainly using MP on ESP32 with Loboris port so I do all my editing via a FTP server. I setup in filezilla that it will open *.py with my selected IDE (note++ ha ha) then I just edit it and click save and filezilla will auto update it over FTP then I just swap to my puTTY terminal window(either ...