Search found 27 matches

by BruinBear
Sun Apr 02, 2017 4:02 pm
Forum: micro:bit boards
Topic: Ultrasonic (US-100/HC-SR04) and sound sensor (KY038) libraries
Replies: 12
Views: 15177

Re: Ultrasonic (US-100/HC-SR04) and sound sensor (KY038) libraries

I tried doubling the SPI frequency but it didn't seem to make any noticeable difference.

I also tried the same code with the SRF005 ultrasonic sensor and it was slightly more accurate, especially at distances up to 10cm where it was only around 3% short. At 30cm, accuracy went down to about 90%.
by BruinBear
Sat Apr 01, 2017 9:16 pm
Forum: micro:bit boards
Topic: Ultrasonic (US-100/HC-SR04) and sound sensor (KY038) libraries
Replies: 12
Views: 15177

Re: Ultrasonic (US-100/HC-SR04) and sound sensor (KY038) libraries

Yes, dual power supply 5v->sensor 3.3v->micro:bit
by BruinBear
Sat Apr 01, 2017 7:40 pm
Forum: micro:bit boards
Topic: Ultrasonic (US-100/HC-SR04) and sound sensor (KY038) libraries
Replies: 12
Views: 15177

Re: Ultrasonic (US-100/HC-SR04) and sound sensor (KY038) libraries

Actually, I just tried the same setup with pxt.microbit.org and the readings obtained using the Sonar package are underestimated by about 50%!
by BruinBear
Sat Apr 01, 2017 5:51 pm
Forum: micro:bit boards
Topic: Ultrasonic (US-100/HC-SR04) and sound sensor (KY038) libraries
Replies: 12
Views: 15177

Re: Ultrasonic (US-100/HC-SR04) and sound sensor (KY038) libraries

fizban I tried it with an HC-SR04 and it works but I'd say it was undermeasuring by around 10%. Using the same module with a Picaxe microprocessor, the results (between 1cm and 1.5m) were accurate to around 1% I'd say. PS There are typos in your example scripts on GitHub. In the library you have: de...
by BruinBear
Sun Mar 19, 2017 1:42 pm
Forum: micro:bit boards
Topic: Using an APA102 LED string (DotStar)
Replies: 4
Views: 5537

Re: Using an APA102 LED string (DotStar)

Thank you deshipu. I have updated the blog post to incorporate your helpful suggestion.
by BruinBear
Sat Mar 18, 2017 11:00 pm
Forum: micro:bit boards
Topic: Using an APA102 LED string (DotStar)
Replies: 4
Views: 5537

Re: Using an APA102 LED string (DotStar)

Good point. I've updated post #1 with the URL of the article.
by BruinBear
Sat Mar 18, 2017 9:40 pm
Forum: micro:bit boards
Topic: Using an APA102 LED string (DotStar)
Replies: 4
Views: 5537

Using an APA102 LED string (DotStar)

In case anybody finds it useful, I have written a guide to using APA102 devices (including DotStar, Blinkt etc.) with MicroPython on the micro:bit on http://www.smythe-consulting.com/2017/0 ... -with.html.
by BruinBear
Thu Mar 02, 2017 12:49 pm
Forum: micro:bit boards
Topic: Adafruit 8x8 LED matrix. More compact code?
Replies: 11
Views: 11923

Re: Adafruit 8x8 LED matrix. More compact code?

Yes, good suggestion. Instead of this: for y, line in enumerate(image): for x in range(8): if line & (1 << x): display.pixel(x, y, 1) display.show() I did this for y, line in enumerate(image): for x in range(8): if line & (1 << x): display.pixel(y, x, 1) display.show() and it is now the same orienta...
by BruinBear
Thu Mar 02, 2017 11:07 am
Forum: micro:bit boards
Topic: Adafruit 8x8 LED matrix. More compact code?
Replies: 11
Views: 11923

Re: Adafruit 8x8 LED matrix. More compact code?

deshipu Your driver works great but, compared with other drivers/code examples, the rows and columns are transposed. Most other examples are oriented with the Adafruit logo at the bottom and the pins at the top. My smiley face example has the Adafruit logo on the right and the pins on the left. Here...
by BruinBear
Mon Feb 27, 2017 6:45 pm
Forum: micro:bit boards
Topic: Adafruit 8x8 LED matrix. More compact code?
Replies: 11
Views: 11923

Re: Adafruit 8x8 LED matrix. More compact code?

Thanks again deshipu. I'm gradually getting the hang of Python "arrays". Sorry I was slow to say "thank you" - I didn't notice that you had replied.