Search found 22 matches

by benalb
Tue Jun 12, 2018 6:05 am
Forum: Other Boards
Topic: MCUDev Black STM32F407VET6 + STM32F407ZET6 dev boards
Replies: 105
Views: 35804

Re: Black STM32F407VET6 + STM32F407ZET6 dev boards

http://wiki.stm32duino.com/index.php?title=STM32F407 In here I have found: http://wiki.stm32duino.com/images/2/26/STM32F407VET6_pinoutDiagram.pdf pinout diagram http://wiki.stm32duino.com/images/0/05/Black_STM32f4VET6_Pinouts_Right.pdf Pinouts right side http://wiki.stm32duino.com/images/3/3e/Black...
by benalb
Thu Mar 29, 2018 2:39 pm
Forum: MicroPython pyboard
Topic: how to execute "OTHER" python scripts
Replies: 10
Views: 1540

Re: how to execute "OTHER" python scripts

I usually do this: cat test01.py def my_test(): print("hello, test") def main(): my_test() if __name__ == "__main__": main() and then, can do: >>> import test01 >>> from test01 import my_test >>> >>> test01.my_test() hello, test >>> test01.main() hello, test >>> >>> my_test() hello, test
by benalb
Mon Oct 30, 2017 7:45 pm
Forum: ESP8266 boards
Topic: Load json
Replies: 6
Views: 1127

Re: Load json

SpotlightKid wrote:
Mon Oct 30, 2017 7:13 pm
This should be:
(... do not use readlines)

Code: Select all

with open(filename) as fp:
	data = ujson.load(fp)
I stand corrected. After test the code, I see that ujson.load is the correct way. :oops:
by benalb
Mon Oct 30, 2017 11:05 am
Forum: ESP8266 boards
Topic: Load json
Replies: 6
Views: 1127

Re: Load json

Hi guys, I would like to load some parameters from a json file. I wrote an example: # mqtt.py : import ujson with open('document.json') as data_file: data = ujson.loads(data_file) (...) What i was wrong? The docs says: ujson.loads(str), Parse the JSON str and return an object. Raises ValueError if ...
by benalb
Fri Oct 27, 2017 3:39 pm
Forum: ESP8266 boards
Topic: [SOLVED] Motor shield for NodeMCU
Replies: 5
Views: 3744

Re: Motor shield for NodeMCU

I am trying to run motor shield with NodeMCU (ESP8266 12N), motor shield doc: https://smartarduino.gitbooks.io/user-mannual-for-esp-12e-motor-shield/content/index.html. (...) I've got the same shield, and it works, with this code you can get the idea: from machine import Pin, PWM """ nodemcu pins f...
by benalb
Tue Oct 24, 2017 6:54 am
Forum: Other Boards
Topic: [STM32F427] Beginner interested in porting to F427
Replies: 7
Views: 1767

Re: [STM32F427] Beginner interested in porting to F427

plunk wrote:
Mon Oct 23, 2017 6:18 pm

The example script I'm using:

Code: Select all

import machine
led = machine.Pin("PG13")
led.high()
I think is led.on()
by benalb
Tue Oct 24, 2017 6:51 am
Forum: General Discussion and Questions
Topic: File mode 'w+'
Replies: 1
Views: 555

Re: File mode 'w+'

Does MicroPython support the 'w+' file mode? MicroPython v1.9.2-144-g98dd126 on 2017-10-05; ESP module with ESP8266 Type "help()" for more information. >>> with open('test.txt', 'w+') as f: ... f.write('hello, world') ... ... ... 12 >>> import uos >>> uos.listdir("/") ['boot.py', 'webrepl_cfg.py', ...
by benalb
Fri Oct 20, 2017 5:23 pm
Forum: Development of MicroPython
Topic: Calling a python function from C
Replies: 14
Views: 11788

Re: Calling a python function from C

[/quote]

The link is dead. Please post another one showing how to call Python from C.
[/quote]

I think this is the right link, with the changes in 1.9 tree:

https://github.com/micropython/micropyt ... pin.c#L118