Im sorry.
I've ment a Instance Variable.
Thanks alot for your input.
I try it asp.
EDIT 3.8.18. 15:38:
It worked thanks alot.
Search found 9 matches
- Fri Aug 03, 2018 9:41 am
- Forum: Development of MicroPython
- Topic: [SOLVED] Class Attributes in Micropython
- Replies: 7
- Views: 4861
- Thu Aug 02, 2018 12:49 pm
- Forum: Development of MicroPython
- Topic: [SOLVED] Class Attributes in Micropython
- Replies: 7
- Views: 4861
[SOLVED] Class Attributes in Micropython
Hi I try to implement a Micropython C Class and I wonder if there is a posibillity, to generate a class like this: >>>class test: >>> testint = 10; In C code. I want to call it in python with >>>testvar = test() >>>testvar.testint 10 I know the implementation of a class but not how to make a Variabl...
- Thu Jul 26, 2018 1:33 pm
- Forum: Development of MicroPython
- Topic: Get an Instance of a Timer
- Replies: 9
- Views: 4608
Re: Get an Instance of a Timer
OK I fond it out by myself,
I cut and past the definition of _pyb_timer_obj_t into the Timer.
If Somebody have a better Solution please tell me.
I don't want to change the HAL of the firmware because of my module.
I cut and past the definition of _pyb_timer_obj_t into the Timer.
If Somebody have a better Solution please tell me.
I don't want to change the HAL of the firmware because of my module.
- Tue Jul 24, 2018 7:47 am
- Forum: Development of MicroPython
- Topic: Get an Instance of a Timer
- Replies: 9
- Views: 4608
Re: Get an Instance of a Timer
At the moment Im playing around and try to understand how the MircoPython Objekts work.
- Mon Jul 23, 2018 5:50 am
- Forum: Development of MicroPython
- Topic: Get an Instance of a Timer
- Replies: 9
- Views: 4608
Re: Get an Instance of a Timer
Oh, I forgot that. How can I access the pyb_timer_obj then? edit: I tryed to modify the timer code so the obj is now public: timer.h: typedef struct _pyb_timer_obj_t pyb_timer_obj_t and the needed change in the timer.c. I have access to the timer obj. now, but now i get the following error: "derefer...
- Fri Jul 20, 2018 9:39 am
- Forum: Development of MicroPython
- Topic: how to redirect stdout
- Replies: 1
- Views: 2246
Re: how to redirect stdout
Hey, after this docu here: http://docs.micropython.org/en/latest/pyboard/genrst/modules.html#overriding-sys-stdin-sys-stdout-and-sys-stderr-not-possible there is no way to do it in Python. But you maybe change it somewhere around around the "micropython\lib\utils\sys_stdio_mphal.c" EDIT: I think its...
- Fri Jul 20, 2018 8:48 am
- Forum: Development of MicroPython
- Topic: Get an Instance of a Timer
- Replies: 9
- Views: 4608
Re: Get an Instance of a Timer
Hey jickster, thanks a lot for your time. I tryed to copy your code into my moule, but I get a "unknown type name 'pyb_timer_obj_t'" Compiler Error. I've included the following files: #include "py/mpconfig.h" #include "py/nlr.h" #include "py/misc.h" #include "py/qstr.h" #include "py/obj.h" #include ...
- Thu Jul 19, 2018 5:42 am
- Forum: Development of MicroPython
- Topic: Get an Instance of a Timer
- Replies: 9
- Views: 4608
Re: Get an Instance of a Timer
[quote=jickster post_id=28696 time=1531935285 user_id=3167] There's plenty of examples of initializing timers. https://github.com/micropython/micropython/search?q=pyb_timer_make_new&unscoped_q=pyb_timer_make_new What specifically do you need to do? [/quote] Hi jickster, thanks for your repl. I know ...
- Wed Jul 18, 2018 12:18 pm
- Forum: Development of MicroPython
- Topic: Get an Instance of a Timer
- Replies: 9
- Views: 4608
Get an Instance of a Timer
Hello, I am currently trying to implement a MicroPython module that init a timer and starts it. But with the following code: [code] mp_obj_t TimerInit (uint8_t uint8TimerNum) { mp_obj_t args[1] = { MP_OBJ_NEW_SMALL_INT(uint8TimerNum) }; return pyb_timer_type.make_new((mp_obj_t)&pyb_timer_type, 1, 0,...