Search found 15 matches

by Sokrates
Sun Jul 17, 2016 9:33 pm
Forum: Hardware Projects
Topic: Modules - Device Drivers
Replies: 20
Views: 12436

SBUS receiver driver

Hello,

I just posted on github a driver for SBUS receivers:
https://github.com/Sokrates80/sbus_driver_micropython
by Sokrates
Mon Jul 11, 2016 9:02 pm
Forum: Hardware Projects
Topic: Introducing airPy: pyboard based flight controller
Replies: 2
Views: 2322

Re: Introducing airPy: pyboard based flight controller

So awesome. Do you think it would run on the ESP8266? I have boards ready for that. The ones I had made use the BMX055, but I also have designs that use the MPU9250 and ordered PCB's with assembly from Seeedstudio. https://github.com/turbinenreiter/10DOF-FeatherWing Hello Turbinenreiter, from the f...
by Sokrates
Sun Jul 10, 2016 10:04 pm
Forum: Hardware Projects
Topic: Introducing airPy: pyboard based flight controller
Replies: 2
Views: 2322

Introducing airPy: pyboard based flight controller

Hello everybody, I have been working on this project for a while so far, and I decided that now it is in an enough mature stage to be published :) . Basically I build a sort of craft shield for the pyboard to turn that into a quadcopter flight controller. A couple of weeks ago I had my first stabili...
by Sokrates
Tue Jan 19, 2016 10:50 pm
Forum: MicroPython pyboard
Topic: best approach for an application config file
Replies: 16
Views: 8505

Re: best approach for an application config file

@Sokrates Your nested dictionary example won't work as posted. Try: >>> d = {} >>> d['dict1'] ={} >>> d['dict2'] ={} >>> d['dict1']['innerkey1'] = 'value1' >>> d['dict2']['innerkey2'] = 'value2' >>> d {'dict2': {'innerkey2': 'value2'}, 'dict1': {'innerkey1': 'value1'}} >>> Yes, you are right. Thank...
by Sokrates
Mon Jan 18, 2016 10:08 pm
Forum: MicroPython pyboard
Topic: best approach for an application config file
Replies: 16
Views: 8505

Re: best approach for an application config file

thanks to everybody. I thinks I will go with ujson. Following some examples that I found on line for future reference: Write data to a file: import json config = {'key1': 'value1', 'key2': 'value2'} f = open('config.json', 'w') f.write(ujson.dumps(config)) f.close() Read data from a file: import jso...
by Sokrates
Sun Jan 17, 2016 2:38 pm
Forum: MicroPython pyboard
Topic: best approach for an application config file
Replies: 16
Views: 8505

best approach for an application config file

Hello, I need a config file for the application running on my pyboard. I need to read/modify a specific attribute on the file and possible create new file if it is missing. My initial approach would be using xml and I'm wondering if anybody could suggest a lib to use. I found the following xmltok bu...
by Sokrates
Sun Jan 17, 2016 2:05 pm
Forum: MicroPython pyboard
Topic: working with UART and Bytearrays
Replies: 29
Views: 12506

Re: working with UART and Bytearrays

I will try to simplify this to work with 2 pyboards to make it easier to evaluate. Will let you know. Regards John I had the same issue. In my project i have to read 25byte frames but I set the buffer read_buf_len to 250. In my understanding it is the "physical" buffer and when you call readinto(my...
by Sokrates
Wed Dec 23, 2015 11:29 am
Forum: MicroPython pyboard
Topic: working with UART and Bytearrays
Replies: 29
Views: 12506

Re: working with UART and Bytearrays

I suggest you look at uart.readinto(buf[, nbytes]) To answer your question, uart.read(1) returns a bytes object with a single element (a bytes object is like bytearray, but is immutable). So you'd need to write uart.read(1)[0] to get a byte. But readinto() allows you to read a specified number of b...
by Sokrates
Tue Dec 22, 2015 7:50 pm
Forum: MicroPython pyboard
Topic: working with UART and Bytearrays
Replies: 29
Views: 12506

working with UART and Bytearrays

Hi all, I'm working with bytes; I have to read 25bytes frames from Uart. At the moment I'm using the following approach and it's working: 1)byte array init: myFrame = bytearray() 2)read 1 byte from uart: tmpByte = uart.read(1) 3) add the byte to the bytearry myFrame.extend(tmpByte) 4) when i get the...
by Sokrates
Sun Dec 20, 2015 7:17 pm
Forum: MicroPython pyboard
Topic: Timer Callback executed just once
Replies: 3
Views: 2035

Re: Timer Callback executed just once

Try changing this line: tim1.callback(statusLed()) to look like: tim1.callback(statusLed) When you create timer callbacks, they also need to take a single argument, which is the timer, so you'll also need to modify: def statusLed(): to look like: def statusLed(tim): What your original code did was ...