Search found 164 matches

by fma
Wed Dec 17, 2014 6:15 am
Forum: General Discussion and Questions
Topic: const() function
Replies: 17
Views: 31777

Re: const() function

I'll give a try with the app I'm currently developing, which uses a lot of constants (this is a port from a C app, which uses a lot of #define) :

https://github.com/fma38/micropython/tree/master/baos
by fma
Tue Dec 16, 2014 12:58 pm
Forum: General Discussion and Questions
Topic: const() function
Replies: 17
Views: 31777

Re: const() function

Ok, I understand ; it is a speed-vs-size tool...

Thanks for the explanation.
by fma
Tue Dec 16, 2014 6:05 am
Forum: General Discussion and Questions
Topic: const() function
Replies: 17
Views: 31777

Re: const() function

Sorry, but I don't really understand what is said in the post; I'm not a C-coder :oops:

It's a constant from a C-dev point of view, am I right?

But from a python point of view, how and when should I use it? What are the pros and cons?
by fma
Mon Dec 15, 2014 7:24 pm
Forum: General Discussion and Questions
Topic: const() function
Replies: 17
Views: 31777

Re: const() function

Still not sure to clearly understand what it does... I made a quick test, and it seems that it consumes memory :?
by fma
Mon Dec 15, 2014 7:02 pm
Forum: General Discussion and Questions
Topic: const() function
Replies: 17
Views: 31777

const() function

Hi!

Reading code from the mpr121 module, I discovered that the author used a const() function to define some constants.

What exactly does this function()? Is it to put the value in the flash, rather than in memory?
by fma
Wed Dec 10, 2014 6:50 pm
Forum: Hardware Projects
Topic: Driver for WS2812 RGB LEDs (NeoPixels, ...)
Replies: 30
Views: 105565

Re: Driver for WS2812 RGB LEDs (NeoPixels, ...)

Great! But as I understand from your post on the other thread, the call to send() is still blocking during transfert, so CPU is not availabe for other tasks. Am I right?
by fma
Wed Dec 10, 2014 11:14 am
Forum: Hardware Projects
Topic: Driver for WS2812 RGB LEDs (NeoPixels, ...)
Replies: 30
Views: 105565

Re: Driver for WS2812 RGB LEDs (NeoPixels, ...)

So, DMA usage is totally transparent?
by fma
Mon Dec 08, 2014 10:03 pm
Forum: General Discussion and Questions
Topic: UART - sending from pyboard to PC
Replies: 17
Views: 23129

Re: UART - sending from pyboard to PC

Why don't you use a real UART on the pyboard, and connect it to your PC using a USB-TTL cable (FTDI)? This way, you keep your usb line for console and program transfert (using pyboard.py), and you have a dedicated serial line to send your own commands...
by fma
Thu Dec 04, 2014 6:18 am
Forum: General Discussion and Questions
Topic: UART - sending from pyboard to PC
Replies: 17
Views: 23129

Re: UART - sending from pyboard to PC

Have a look at the pyboard.py script, which is uses to transmit and run scripts to pyboard...
by fma
Fri Nov 28, 2014 1:35 pm
Forum: General Discussion and Questions
Topic: UART - sending from pyboard to PC
Replies: 17
Views: 23129

Re: UART - sending from pyboard to PC

@ulrich, the port /dev/ttyACM0 is bind to the virtual serial line over usb; UART(1) is a real serial line, connected to X9/X10: http://micropython.org/resources/pybv10-pinout.jpg If you want to test this real serial line, you need to connect it to your PC, through a FTDI cable, for example (USB-TTL,...