#circuitpython-dev

1 messages ยท Page 160 of 1

lusty tangle
#

correct

#

my lib dir only contains:
adafriud_hid
adafruit_dotstar.mpy

raven canopy
#

i almost @'d you Dan... ๐Ÿ˜„

tulip sleet
#

@lusty tangle Try putting a time.sleep(1) before you do mouse = Mouse(). I had one support issue where the CPy code was faster than the host computer in terms of them negotiating the USB HID devices

#

you'll need to import time if you aren't doing that already

lusty tangle
#

@tulip sleet you are a genius! That fixed it. Thank you!! @raven canopy

raven canopy
#

verified on my end too. there is that OS Error that was popping up. thanks @tulip sleet!

lusty tangle
#

Thank you everyone. Have a great evening!

tidal kiln
#

i guess i'll just :q!

raven canopy
#

you too @lusty tangle. And I think that is a candidate for a doc update...

#

@tulip sleet does that affect all 3 instances, or just mouse?

#

updating doc

lusty tangle
#

Might be too much to ask, but any idea why makecode didn't work?

tulip sleet
#

what is your OS, @lusty tangle

lusty tangle
#

Windows 10

tulip sleet
#

@lusty tangle is PhunkMaster your github id too, or is that a different person with the same username?

lusty tangle
#

That is me as well

tulip sleet
lusty tangle
#

First time I've ever helped to find a bug! Yay!

tulip sleet
#

thanks very much - it wasn't clear to me how common this was. It definitely doesn't happen for everyone, but I'm not sure when it does - we should retry

lusty tangle
#

Glad to be of assistance, and I thank everyone that chimed in here tonight for helping me.

#

I need to get some sleep, I'll check back this weekend to chat about why makecode didn't work for this project.

raven canopy
#

@tulip sleet I've updated the README and examples for now. I won't update the API docs; no logical place to put it.

idle owl
#

Now the feather is ejecting as soon as it mounts. Running 3.0 and an iteration of my earlier code.

#

I have to head out, I'll post the code tomorrow, I managed to grab it quickly. It doesn't look like the code is running anymore. Also I had the purple status LED while the code was running. It's not currently and the LED is green. I am still able to screen into it.

#

That's why I don't think the code is running anymore.

tulip sleet
#

@lusty tangle could you post your previous failing code in the issue: https://github.com/adafruit/Adafruit_CircuitPython_HID/issues/13? Based on the library code, it's not clear to me why it's failing on m = Mouse(), but it might be failing on the first attempt to move the mouse. I'd like to try to reproduce this. Or @raven canopy, if you have failing code, could you post it? I think I know how to fix it easily but want to double-check.

lusty tangle
#

@tulip sleet I updated the issue with my failing code.

tulip sleet
#

thanks!

lusty tangle
#

No problem!

unreal ginkgo
#

what are the things needed to add support to a playground express for extra neopixels?

tidal kiln
#

just hardware, software-wise it's the same as what's driving the neopixels on the board

#

do you already have the extra neopixels?

unreal ginkgo
#

yeah, i just wasn't sure what to modify to get the extra ones working

tidal kiln
#

also - you can't really "extend" the existing pixels, you basically just add another strand to one of the pads, and then you'd talk to it separately

#

what are the xtra ones you have?

unreal ginkgo
#

i've got 4 individual ones and a 12 ring

tidal kiln
#

do you know the product numbers for them? (since we have a lot of flavors, RGB, RGBW, etc)

unreal ginkgo
#

PRODUCT ID: 1260
PRODUCT ID: 1643

tidal kiln
#

looks like both are RGB

#

do you want to hook them all up, or just some of them

#

mainly a hardware thing on how to go about it

unreal ginkgo
#

i'll be hooking them all up, and i'm not quite sure how

#

well, for now i'll just be trying to hook one or two up to see if i can get it working

tidal kiln
#

toward the bottom it shows how to add external neopixels

onyx hinge
#

It takes a surprising length of time to update that 128x32 OLED over I2C, 60-80ms. Is that likely to be due to using bitbangio.SPI, or is it inherent in I2C? Perhaps I simply need to modify my expectations.

My Python code is a fill(), 5 text() calls that show about 30 characters in all, and show().

tidal kiln
#

@onyx hinge it maybe could be optimized some, but i think that's about it. the i2c speed can be a bottle neck. but still, that's ~12FPS. not horrible.

#

oh wait. you said SPI.

#

which is it?

onyx hinge
#

er er no, bitbangio.I2C

#

sorry

tidal kiln
#

ah. ok.

#

spi can go faster

onyx hinge
#

it's the feather wing, I don't think I can switch it to SPI

#

oops afk

tidal kiln
#

correct
"To make it as cross-platform compatible as possible, we use only I2C to control the display. This is not as fast as SPI but it uses only two pins"

unreal ginkgo
#

i guess now it's me being uncertain what i need to put in to make the extra pixels usable
like
the code i need is probably in what you sent and i'm just
not realizing it

tidal kiln
#

i don't think it has a good code example, but the main key is just specifying the pin when you create the neopixel object:

neopixel_ring = neopixel.NeoPixel(board.A2, 12)
unreal ginkgo
#

alright! thanks, there's a lot of things that are simple but wouldn't really occur to me

tidal kiln
#

how do you plan to wire them in? i think that'll be the trickier part, esp. if you don't plan to solder.

unreal ginkgo
#

i've got a handful of clips

#

this is just to test for now

#

do i just kinda
attach clips to clips to keep the power going through to multiple pixels?

tidal kiln
#

for those individual flora pixels?

unreal ginkgo
#

yeah

tidal kiln
#

for power, yes, so all the - are attached together, and all the + are attached together

unreal ginkgo
#

alright

tidal kiln
#

for data, it's like a daisy chain, so you'll come out of the CPX pin and into the first pixels in pin, then that pixels out pin goes to the next pixels in pin, etc

#

the little arrows show the data flow, it's like a pipe

unreal ginkgo
#

alright

#

i tried testing it out and

#

it doesn't seem to recognize the IR remote anymore

tidal kiln
#

what's the ir remote?

unreal ginkgo
#

the mini one

#

"ImportError: no module named 'adafruit_irremote'"

#

it was working fine before so?

tidal kiln
#

it's acting like the module library isn't there anymore. did you delete things? or do any re-installing of stuff on the CPX?

unreal ginkgo
#

not at all

#

at least as far as i know

tidal kiln
#

check if the file is there: CIRCUITPY/lib/adafruit_irremote.mpy

unreal ginkgo
#

i

#

i have no idea what happened

#

but the thing is blank

tidal kiln
#

your CIRCUITPY folder is blank / empty?

unreal ginkgo
#

not even

#

it's coming up as usb drive

tidal kiln
#

that's fine. it should. and then you can look at whats on it.

unreal ginkgo
#

that's it

tidal kiln
#

hmmm. yah. somehow things got deleted.

unreal ginkgo
#

fun

tidal kiln
#

what's in the boot_out file?

unreal ginkgo
#

"Adafruit CircuitPython 2.2.4 on 2018-03-07; Adafruit CircuitPlayground Express with samd21g18"

tidal kiln
#

that's all good

#

do you know how to reinstall the libraries?

unreal ginkgo
#

hit reset?

#

and go from there?

#

got all my code backed up in that case

tidal kiln
#

easier. just need to drag the files back over on to the drive.

#

the CPX is an Express board, so you can just copy the whole lib folder over

unreal ginkgo
#

alright!

#

seems to be working again

tidal kiln
#

yeah

unreal ginkgo
#

the ring has a single green liight

#

i'm not sure if that's good or not

tidal kiln
#

are your clips alligator clips, or something else?

unreal ginkgo
#

yeah, alligator clips

tidal kiln
#

might be tough to get a good reliable connection on the ring with those

#

it was meant more for a solder connection

unreal ginkgo
#

yeah

tidal kiln
#

but what's your code look like?

unreal ginkgo
#

again, im just trying to test this all before getting it properly made

#

readjusted the lips
now i've got 2 lights and a bit more blindness

tidal kiln
#

pixels is your ring?

unreal ginkgo
#

no, that's the on board

#

i'm not quite sure what to do to get both going on the same things

#

also i should probably start wearing sunglasses

tidal kiln
#

that has been known to be done by people working with neopixels ๐Ÿ˜Ž

#

what pads on the CPX do you have the ring connected to?

unreal ginkgo
#

Vout, GND, A2

#

okay

#

it seems to have wiped itself again

tidal kiln
#

like all the files are missing in CIRCUITPY ?

unreal ginkgo
#

yep

tidal kiln
#

weird. what were you doing when it happened?

unreal ginkgo
#

no clue

#

as in i dont know when it happened

tidal kiln
#

no sure what could be doing that.

unreal ginkgo
#

how much of an effect do magnets have

#

because there are some in my laptop for whatever reason

tidal kiln
#

wouldn't expect those to be an issue

unreal ginkgo
#

just wanted to make sure

tidal kiln
#

if they were strong enough to be a problem, your laptop woldn't be happy either

unreal ginkgo
#

alright

#

at one point the neopixels on the express flashed red and i'm not sure what i did to have that happen

tidal kiln
#

it might have been your code, since you said pixels is the onboard ones, and you're using that

unreal ginkgo
#

ahhh

#

i'm not sure how to use both

tidal kiln
#

i can show you how, but i'm concerned about why your files keep disappearing

unreal ginkgo
#

yeah so am i

#

it might be due to weird connections and fidgety clips

tidal kiln
#

yah. not sure.

#

try using just a single one of the flora ones

#

alligator clips go on those much easier

unreal ginkgo
#

alright

#

seems to work with a single pixel

tidal kiln
#

here's the basics of using the two different neopixel strands:

import board
import neopixel

onboard_pixels = neopixel.NeoPixel(board.NEOPIXEL, 10, brightness=0.2) 
offboard_pixels = neopixel.NeoPixel(board.A2, 1, brightness=0.2) 

onboard_pixels.fill((0,0,255))
offboard_pixels.fill((0,255,0))
unreal ginkgo
#

alright

#

thanks

slender iron
#

@unreal ginkgo are you pressing the reset button?

unreal ginkgo
#

no

slender iron
#

hrm, not sure why the filesystem is changing then

unreal ginkgo
#

seems to mostly work with 3 pixels

#

i'd check to see if it worked with 4 but
i must have forgotten a clip at home

#

now i've got how to do the basics of setting these up, i'll try and get the ring set up laterrrrrrrrrrrrr

#

forgot that i only had 12 cords

#

well i can always use 2 individuals and the sewing to ring adapter

#

well, i'll get this done later, i've gotten a ton of work done in the past hour and it feels great

slender iron
#

good job @unreal ginkgo !

manic glacierBOT
slender iron
#

@stuck elbow the uGame Turbo looks awesome! One correction from the Microcontroller log is that the SAMD51 is 120mhz, not 48.

stuck elbow
#

@slender iron thanks, I will fix i

#

it

#

no idea where I took the 48MHz figure

slender iron
#

np ๐Ÿ˜ƒ

#

I think SAMD51 is the way to go but I'm biased

stuck elbow
#

I'm still a bit afraid of all those passives necessary for it

slender iron
#

have you looked at my 3.x audio work yet?

stuck elbow
#

no, I've been a bit busy with the e-paper stuff

slender iron
#

how many passives? the inductor?

#

oooh nice!

#

I think it'd be possible to do audio mixing in C code

stuck elbow
#

this weekend there is the hackaday unconference, so probably I will look next week

#

nice!

slender iron
#

k, I

#

I'm working on wave playback now

stuck elbow
#

multi-channel sound!

slender iron
#

and mp3 shouldn't be too hard to add for the 51

#

yeah, I have stereo output working already

stuck elbow
#

so I could do music on one channel and sound effects on the other

slender iron
#

I think so. I haven't tried it from two different sources but it shouldn't be hard to fix if it doesn't work

stuck elbow
#

I think this is going to be the perfect device for games in Python

slender iron
#

yeah totally

stuck elbow
#

the samd51 chips already came โ€” the ones with 256MB RAM

slender iron
#

I was up late last night brainstorming ways of programming a gameboy with circuitpython

#

basically using the gameboy cpu to talk to the peripherals

stuck elbow
#

nice, you could have a cartridge

#

the gameboy bus breaks out everything

slender iron
#

yeah, cartridge would be the way to go

idle owl
#

Does anyone know how to flush the file you're writing data to with datalogging to an SD card?

tidal kiln
#

i think there's a flush function

idle owl
#

Wait, no what I was asked to do was specifically this: "after each data log 'flush' the file by closing it"

#

And I'm unsure what that means

tidal kiln
#

so am i

idle owl
#

Fair enough. I'll ask instead then

tidal kiln
#

what does "each data log" mean though?

solar whale
#

I am trying to communicate from a CPX to an ESP8266 feather via UART. I have the CPX TX/RX connected to the RX/TX pins of the ESP8266. Every thing works great as long as I have a USB data cable connected to the ESP8266, but if I remove that cable, and power the ESP8266 any other way, then the RX line to the ESP 8266 does not work. I still receive data at the CPX via TX, but the ESP8266 does not receiver anything. On the Feather there is a 1K resistor between USB_RX and RX. Do I need to do something with RX to make this work??

tidal kiln
#

i guess i could read that as "when you're done logging, close the file"

#

which makes sense

#

@solar whale GNDs connected between the boards?

solar whale
#

yes

#

oops - off by a pin

#

well taht was embarrassing

idle owl
#

Well it makes me feel better about things, so there's that part of it, @solar whale

solar whale
#

@tidal kiln thanks!

#

@idle owl it good practice to close you file after each write - then reopen it - that wa it is "safe" between writes.

idle owl
#

Oooh that sounds right, how do I do that?

#

I almost pinged you but then thought maybe what you had done with SD card stuff wasn't this

solar whale
#

close(fp)

#

just a sec - looking for an example.

idle owl
#

Thank you

tidal kiln
#

what's the time between writes?

idle owl
#

3 seconds

solar whale
#

or you can do fp.close() and re-open it every time.

tidal kiln
#

i'd just let the context manager do that

idle owl
#

Ok next question, I have \n in there but it's not doing a new line

tidal kiln
#

is the idea to make sure data doesn't get lost if something happens in the logging loop?

#

@idle owl post that line of code

solar whale
#

how do you know it is not doing a newline?

idle owl
#

I looked at the log file

#

and it's all on one line

#

426.221.426.221.426.221.326.221.326.221.326.221.426.221.326.221.326.221.326.221.326.221.326.222.226.321.326.221.326.221.326.221.426.221.326.221.426.121.326.221.326.221.326.221.426.221.426.221.426.221.426.221.426.321.426.321.426.221.426.221.426.221.426.221.426.221.426.221.426.221.426.221.426.221.426.221.426.221.426.221.426.221.326.221.426.221.426.221.426.221.426.221.426.221.426.221.426.221.426.221.426.222.226.321.426.321.426.321.426.421.426.421.426.321.426.321.426.321.426.321.326.321.426.321.426.321.426.321.426.321.426.321.426.322.126.421.226.422.529.122.628.922.528.622.528.322.527.822.427.322.426.822.426.422.326.122.325.922.325.722.225.622.225.522.225.422.125.423.425.523.725.6etc.

solar whale
#

can you post the line that is writing it out

idle owl
#

sdc.write("{}\n".format(humidity))

solar whale
#

the flush example above should be OK - and the context manager will close the file

idle owl
#

It's writing two pieces of data

#

temp and humidity

tidal kiln
#

two? where's the other one coming from?

solar whale
#

can you post a bigger code snippet

idle owl
#

same sensor different line

#

yes

#

it's supposed to log 3 pieces when this is done

#

but I'm unsure about the output of data number 3 and haven't written it to the card yet

tidal kiln
#

f.write("{},{},{}\n".format(x,y,z)) <-- what i've done

idle owl
#
            temperature = am2320.temperature
            humidity = am2320.relative_humidity
            print("Temperature:", temperature)
            sdc.write("{}\n".format(temperature))
            print("Humidity:", humidity)
            sdc.write("{}\n".format(humidity))
            sdc.flush()
            time.sleep(3)```
#

if that's the right way to use flush anyway

#

I just now put it in there.

tidal kiln
#

can you upload one of the log.txt files

idle owl
#

for the record, It worked right with the original example code as per what you're about to see if you look at this file, then I screwed it up somewhere along the line.

solar whale
#

you are opening for append - fi there is old stuff at the start of the file - it will still be there - have you deleted the file before testing a new version?

idle owl
#

no I hadn't done that

tidal kiln
#

worked...worked differently....didn't work ๐Ÿ˜ฆ

idle owl
#

yes.

tidal kiln
#

yah delete it and make a fresh one

#

also, just do the writes with one line (see above)

solar whale
#

@tidal kiln Luckily my ground was connected to a "NC" pin on the feather -- that was driving me nuts

tidal kiln
#

ha. glad it was that simple. the 'ole north carolina pin.

solar whale
#

I have my esp8266 set up so it looks for an input via UART with a feed name and value then sends it to adafriut.io -- Now I can ust the CPX or any board to send sensor values to my adafruit io.

idle owl
#

ok new file writing

#

Hey!

#

It worked!

#

Why!

#

lol

#

That doesn't make sense

solar whale
#

Yay!

#

sure it does - we are watching....

tidal kiln
#

ha. seems to be a recurring theme with your current bug fixes.

idle owl
#

Right?

#

It did that I2C thing again, I unplugged and replugged and it went back to working

tidal kiln
#

@solar whale neat. so like a serial to internet bridge.

solar whale
#

yes - very simple - but seems to be working

tidal kiln
#

@idle owl next time the i2c stops working, try hooking up the saleasesaes and see what it's doing

solar whale
#

@idle owl when I2C stops workig - does it not even recover with a soft (control-D) reboot?

idle owl
#

Correct

#

Not even pressing the reset button worked

solar whale
#

odd - this with the am2302

#

2320

idle owl
#

yes, but it also loses the Adalogger FeatherWing

#

when that happens

solar whale
#

the adalogger is SPI, correct? do you have pullups on the AM2320 i2c lines?

idle owl
#

The RTC is I2C

#

when I had that running as well, it would lose that address as well

#

and yes I do

solar whale
#

hmm - althought I expect the RTC also has pullups on it - what size resistors on the am2320

idle owl
#

10k

#

Can't use the RTC anymore, it won't run with SD Card code

solar whale
#

why?

tidal kiln
#

yes. feather wing also has 10k's

idle owl
#

Memory

#

not enough of it

solar whale
#

ah - yes - I remember tryin that!

#

but with the featherwing plugged in I think the extra pullups are not needed but wont hurt, correct @tidal kiln ?

tidal kiln
#

generally correct, they act in parallel so reduce the over all pull up, would just need to keep that in mind

#

doubt thats whats happening though

solar whale
#

@idle owl would it be usful to try another i2c temp/hum sensor to see if the hangups are only due to the am2320?

#

what board are you using. I can try to replicate this if you would like. - I have the parts

tidal kiln
#

(its a feather m0 express)

#

photos are up there in the scroll back somewhere yesterday-ish

solar whale
#

ah - saw them flash by - I'll give it a try.

idle owl
#

The RTC is also I2C, different sensor, and stopped working, or are you thinking it stopped all I2C because the AM2320 was connected at all?

solar whale
#

just a thought - that the am2320 was doing something nasty

tidal kiln
#

^^ could be, or getting in a foul state, thus the suggestion to use the saleae

#

another test would be to actually power cycle and not just press reset

solar whale
#

yup - good idea - I do have an am2320 connected to am m0_express with the adalogger featherwing running.

#

@idle owl if you want me to run you code, I'll be happy to

#

is there some action that triggers the i2c hangup?

idle owl
#

Nope

#

It was random

#

I used I2C scan last night to test my soldering, and it worked

#

er night before last

#

then yesterday started writing code for it

solar whale
#

2.24 or 3.0

idle owl
#

and then it lost I2C

#

2.2.4

#

so I sat on I2C scan for a while, but it didn't get fixed until I unplugged it completely and plugged it back in.

#

Then randomly happened again later yesterday

#

Same routine fixed it

solar whale
#

I have 3.0 on this systems

idle owl
#

Hasn't happened again since.

solar whale
#

but it just happend a few minutes ago?

idle owl
#

no, I was referencing that it happened again last night

solar whale
#

ah - misunderstood -- I'm logging some data on mine now - so far so good.

idle owl
#

Thanks for testing!

solar whale
#

np - fun to do...

#

the flush statement seems to be working - at least it does not cause any problems ๐Ÿ˜‰

languid sage
#

@solar whale saw your recent post... reminds me of the guy that jumped out of a 10 story build. As he passed each floor he said "well, so far so good".

solar whale
#

It's not the fall. -- its the landing....;-)

#

I have to run out for a bit -- I'll leave it logging for awhile @idle owl ( don't think I'll fill my 4Gbyte card) Let me know if there is anything special you want tested.

split ocean
#

hi any rtttl people and @slender iron have a question from a person in the forums about running rtttl on CPX. I was able to get it working very faintly on a piezo connected to A0, but all other pins return ValueError: Invalid pin Any thoughts on using this library on CPX?

slender iron
#

make sure its the latest rtttl

split ocean
#

2.2.3 rtttl or 3.0.0 alpha or either? Or neither?

slender iron
#

2.1.1 of the library

split ocean
#

the bundle?

slender iron
split ocean
#

ah, yes, I see that now. Yes, that's what I'm trying with.

#

what should it do on a CPX? Not onboard speaker right, only a piezo?

slender iron
#

on board speaker will be a sine wave instead of square

#

and you need to enable the amp

split ocean
#

I'm getting this error Traceback (most recent call last): File "main.py", line 4, in <module> File "adafruit_rtttl.py", line 179, in play File "adafruit_rtttl.py", line 134, in _play_to_pin KeyboardInterrupt: soft reboot

#

running this code:

#
import board

adafruit_rtttl.play(board.A0, "Bond:d=4,o=5,b=320:c,8d,8d,d,2d,c,c,c,c,8d#,8d#,2d#,d,d,d,c,8d,8d,d,2d,c,c,c,c,8d#,8d#,d#,2d#,d,c#,c,c6,1b.,g,f,1g.")```
#

i didn't see amp enable on the docs, I'll check them again

tulip sleet
#
# enable the speaker
spkrenable = DigitalInOut(board.SPEAKER_ENABLE)
spkrenable.direction = Direction.OUTPUT
spkrenable.value = True
idle owl
#

My I2C just failed again. @solar whale let me know when you're back if your code is still running.

solar whale
#

@idle owl I stopped it after about 10 min- I'll restart and let it run for longer

#

sorry - need to do another test - logging now.

split ocean
#

thanks @tulip sleet and @slender iron and @idle owl I have it working now.

idle owl
#

@solar whale When it fails, does it tell you that there's nothing at I2C address 5c if you do ctrl+d in the serial output?

solar whale
#

It has not failed for me

idle owl
#

oh I misread

#

you stopped it

#

got it

split ocean
#

I'll update the Spy Music guide to include this option (it was originally written for Gemma M0) and maybe we can add the example on the rtttl docs too.

solar whale
#

yes - no errors for me yet

#

@idle owl FYI this is what I am running ```import time
import board
import busio
import adafruit_am2320
import adafruit_sdcard
import digitalio
import storage

can also use board.SDA and board.SCL for neater looking code!

i2c = busio.I2C(board.SCL, board.SDA)
am2320 = adafruit_am2320.AM2320(i2c)

Connect to the card and mount the filesystem.

spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
cs = digitalio.DigitalInOut(board.D5)
sdcard = adafruit_sdcard.SDCard(spi, cs)
sdc = storage.VfsFat(sdcard)
storage.mount(sdc, "/sd_card")

while True:
try:
with open("/sd_card/log.txt", "a") as sdc:
temperature = am2320.temperature
humidity = am2320.relative_humidity
print("Temperature:", temperature)
print("Humidity:", humidity)
sdc.write("{},{}\n".format(temperature,humidity))
sdc.flush()
time.sleep(3)
except OSError:
print("OSError reported")
# These sensors are a bit flakey, its ok if the readings fail
pass
except RuntimeError:
print("RunTime reported")
pass
time.sleep(2)

idle owl
solar whale
#

combo of am2320_simpletest and sd logger...

#

remarkably similar ๐Ÿ˜‰

#

not surprising since I stole your logging code...

split ocean
#

@slender iron I don't know the procedure for updating ReadTheDocs, but here's the CPX exampe of Frosty if you want to include it: import board from digitalio import DigitalInOut, Direction import adafruit_rtttl spkrenable = DigitalInOut(board.SPEAKER_ENABLE) spkrenable.direction = Direction.OUTPUT spkrenable.value = True adafruit_rtttl.play(board.A0, "Snowman:d=8,o=5,b=200:2g,4e.,f,4g,2c6,b,c6,4d6,4c6,4b,a,2g.,b,c6,4d6,4c6,4b,a,a,g,4c6,4e.,g,a,4g,4f,4e,4d,2c.,4c,4a,4a,4c6,4c6,4b,4a,4g,4e,4f,4a,4g,4f,2e.,4e,4d,4d,4g,4g,4b,4b,4d6,d6,b,4d6,4c6,4b,4a,4g,4p,2g") print("ending...")

slender iron
#

@split ocean do you have a particular page you want to put it on?

split ocean
slender iron
solar whale
#

@idle owl I switched to running your code now -- (only change is D5 instead of D10)

split ocean
#

cool, I'll update that page, thanks

river quest
feral saffron
#

why is this lsm303 being such a pain in the butt... i can't figure out how to get a normal functioning compass on this thing... is my math that bad? LOL
heading = (math.atan2(mag_y, mag_x) * (180 / math.pi))

cunning crypt
#

@river quest Awesome list.

fierce oar
#

sweet! i'm heading straight for the art pack ๐Ÿ˜

river quest
#

i'll keep adding more to it, this was train ride github stuff to get us started

stuck elbow
#

@river quest would pull requests be appropriate?

river quest
#

@stuck elbow please do!

#

i put this in.. Contributing
Contributions and suggestions are always welcome! Please make pull requests to modify Awesome CircuitPython.

stuck elbow
#

I didn't get to that part yet, thanks

feral saffron
#

I swear my LSM303 is bugged or something...

stuck elbow
#

that's possible but unlikely

manic glacierBOT
tidal kiln
#

@feral saffron do the values for mag_y and max_x seem to be OK?

feral saffron
#

@tidal kiln what do you mean by ok? What values should I expect?

tidal kiln
#

like if you point due north, do you get 0,1 and then point due west get 1,0? not sure about exact values w.r.t. orientation.

feral saffron
#

@tidal kiln i get numbers from like -3 to .5 on x

#

if i keep it level

tidal kiln
feral saffron
#

so mag heading should be based on X and Y

tidal kiln
#

yep. if you hold it with chip level.

#

with Z pointing up

feral saffron
#

yup

tidal kiln
#

so point X roughly North and what do you get formag_x and mag_y

feral saffron
#

~2.1

tidal kiln
#

for both?

feral saffron
#

2.5 for x , - 2.2 for y

#

if i point X towards north, and then point Y towards north

#

according the diagram on the board

tidal kiln
#

which one are those values for? X towards north, or Y towards north?

feral saffron
#

2.5 for x while X is pointing towards north
-2.2 for y while Y is pointing towards north

tidal kiln
#

but what are both values for both orientations?
X pointing north, mag_x = 2.5 mag_y = ?
Y pointing north, mag_x = ? mag_y = -2.2

feral saffron
#

ah, i see. one sec. i'm getting some crazy differences each time i check this... not sure why

#

i'll get that for you in one sec

tidal kiln
#

are you getting fluctuating readings with it held in one orientation?

#

something could be interfering

feral saffron
#
y -> N : mag_x = -1, mag_y = -1.45```
tidal kiln
#

weird. no change in y.

feral saffron
#

it doesn't change while stationary, but i'm not getting consistent results at all

#

also same results with the lsm9ds0

#

i bought the lsm303 hoping i had a bad lsm9ds0

#

didn't know that was a bad word ๐Ÿ˜„

#

i'm losing my mind over this

tidal kiln
#

realize it's basically a magnet sensor, so will sense any magnetic fields

#

maybe try different locations to see if you can get better readings

feral saffron
#

i'm not working near an MRI... lol

tidal kiln
#

it doesn't take much

feral saffron
#

wouldn't the sensor in my phone also be thrown off?

#

i'm using that to get the correct heading

tidal kiln
#

that's probably been very much calibrated for it's integration into the phone

feral saffron
#

hmm, i can't really test it outside from 10 ft from my pc (no output device)

tidal kiln
#

and may be using other sensors like the accelerometer to compensate

feral saffron
#

i've tried accelerometer compensation code too lol

tidal kiln
#

you can try different locations even within reach of a USB cable and see if you tell any difference

feral saffron
#
y -> N : mag_x = -1 mag_y =-1.72
#

not much difference

#

๐Ÿค”

tidal kiln
#

that's really weird how y isn't changing much

feral saffron
#

yeah, so confused

#

technically i could do the same with Z access?

tidal kiln
#

sure

feral saffron
#

z -> north mag_z = 1, x -3.2

#

frustration level 110% , i'm done for the day lol thanks for your help @tidal kiln

tidal kiln
#

ok. good luck. sry couldn't help more.

#

nothing wrong with your compass math, so just keep playing around looking at the raw readings to see if you can figure anything out

feral saffron
#

@tidal kiln i did test its mins and maxes in all directions and discovered that it does do pretty good with all directions spherically ... not sure why its not giving me a true heading though =/

unreal ginkgo
#

ahaaaaaaaa

#

everything is working perfectly

#

okay not perfectly but good enough for me

#

only thing that is off is the bike light rainbow function doesn't fully fill the ring but i'm fine with that

cobalt dawn
#

as in a few lights are off ?

unreal ginkgo
#

nah, the lights are on

#

it just doesn't fully makes the thing go the entire way around the ring

#

but you wont really be able to tell with how it'll be set up so i dont mind

cobalt dawn
#

ahh

#

thing is , the maker in me wants to fix it

unreal ginkgo
#

actually

cobalt dawn
#

in cp do you set a count like you do in Arduino?

unreal ginkgo
#

not sure but

#

it's a mix of
do i want to have all of them light up
or do i not want to have to readjust all the timing

#

alternatively i can just copypaste the entire code

#

actually, can i just kinda
hm
put a handful of these codes into a separate file and just use it remotely?

#

some of the definition stuff

tidal kiln
unreal ginkgo
#

yep

tidal kiln
#

you're trying to get that to work on your external ring?

unreal ginkgo
#

i've got it working

#

it's just that like uh

languid sage
#

@feral saffron using your phone is probably not the same thing. Cell Phones have GPS, and use precise data to determine North, etc. Magnetic declination (due to the fact that the magnetic north pole is somewhere in eastern Canada and not as the true N pole) varies all over the planet. In NYC it's about 13 degrees East. In California its about 14-15 degrees West, i.e., in the other direction. Add an app called GPS Status to your phone. if it shows exactly what the phone is showing now, then you are using GPS for direction and not magnetic north.

unreal ginkgo
#

"for p in range(10):
pixels[p] = RAINBOW_COLORS[color]
neopixel_ring[p] = RAINBOW_COLORS[color]"

#

i could do a seperate line to set up the pixels for the ring

#

but that would also require redoing the timing for the lights

tidal kiln
#

this is for your 12 pixel ring?

unreal ginkgo
#

yeah, with another 4 connected to it

#

i think it's more of a space thing

tidal kiln
#

that code is sort of hardwired for only 10 pixels

unreal ginkgo
#

yeah i dont mind that

tidal kiln
#

since it was meant to use the ring of pixels on the board

unreal ginkgo
#

yeah

#

yeah i'm fine with it only lighting up 10 of the 16 pixels on that

#

i've got all of them lit up when running

#

and honestly it only changes the color of every other pixel, it's just the timing and order thing that i used it for

tidal kiln
#

ah cool - sounds like you've got things wired so all the pixels are working?

unreal ginkgo
#

in a way, yeah

#

my grandfather had a thing of wire strippers and i had the sewable pixel to ring adapter so i checked if everything was working

#

and yeah, it all seemed to be okay

tidal kiln
#

a simple way to test is to just use the fill function, and see if they all light up the same color

unreal ginkgo
#

a majority of my code is that function

#

it was simply getting it to work with the other 2 things that i was testing

#

and they seemed to work

#

tomorrow i'll start trying to figure out the sound

idle owl
#

@solar whale Around?

onyx hinge
#

hm, I'm having trouble getting the esp8266 huzza build to work. I built the toolchain as described in README.md, and cpy2 reaches the linker stage but encounters an error: xtensa-lx106-elf-ld: build/firmware.elf section `.text' will not fit in region `iram1_0_seg' xtensa-lx106-elf-ld: region `iram1_0_seg' overflowed by 60640 bytes Makefile:246: recipe for target 'build/firmware.elf' failed

#

gcc version 4.8.5 (crosstool-NG crosstool-ng-1.22.0-60-g37b07f6f) is this the expected version for the xtensa toolchain or did I take a time machine?

#

there is some version skew between the toolchain and circuitpython, because there were prototypes in esp8266/etshal.h which didn't match the SDK leading to errors. Those could be resolved by simply deleting the declaration in etshal.h.

#

a similar error (number of bytes of overflow differ) building master branch ๐Ÿ˜•

#

micropython 's own master branch does build, hm.

#

aha! pull request incoming

manic glacierBOT
onyx hinge
#

phew, that's better.

solar whale
#

@idle owl sorry - was out - my logger is still running...

idle owl
#

I have new code for you to try.

#

Mine stopped.

solar whale
#

@onyx hinge Is this a new SDK - I have been building ESP8266 regularly but have not updated SDK recently.

idle owl
#

I just noticed this.

#

It stopped an hour ago.

#
Temperature: 22.0
Humidity: 25.8
VBat voltage: 3.84946

Traceback (most recent call last):
  File "code.py", line 54, in <module>
  File "code.py", line 36, in <module>
  File "adafruit_pcf8523.py", line 121, in datetime
  File "adafruit_register/i2c_bcd_datetime.py", line 79, in __get__
  File "adafruit_bus_device/i2c_device.py", line 110, in __exit__
KeyboardInterrupt:
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Traceback (most recent call last):
  File "code.py", line 17, in <module>
  File "adafruit_pcf8523.py", line 103, in __init__
  File "adafruit_bus_device/i2c_device.py", line 68, in __init__
  File "adafruit_bus_device/i2c_device.py", line 66, in __init__
ValueError: No I2C device at address: 68```
#

It will just hang with printing out the info

#

and then if you ctrl+D or ctrl+C it, it will give you the failure.

#

68 is the RTC address.

#

which is I2C

solar whale
#

OK - I'll try it - RTC stuff was not in the version from before.

idle owl
#

Correct

#

It wasn't working until we imported it in a certain order and threw in extra gc.collect() so....

#

the SD card lib and the RTC lib fail memory allocation if loaded together otherwise.

#

The code ran last time from 20:11 to 20:53 before it stopped reading I2C.

solar whale
#

I get memory allocation error

idle owl
#

sigh.

#

On 2.2.4?

#

Because it won't work on 3.0, at least it didn't for me earlier.

solar whale
#

no - 3.0

idle owl
#

Yeah... doesn't make much sense because the memory stuff is better in 3.0, but there it is.

#

Can you load it on 2.2.4 for me? Or will that not work

solar whale
#
>>> 
>>> 
>>> import am2320_rtc
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "am2320_rtc.py", line 6, in <module>
  File "adafruit_am2320.py", line 80, in <module>
MemoryError: memory allocation failed, allocating 136 byte
>>> 
idle owl
#

That's a new number.

#

It was 628 for me

solar whale
#

I can do it tomorrow morning.

idle owl
#

Ok

solar whale
#

I had 628 once

#

just tried again - got 628 ๐Ÿ˜‰

idle owl
#

๐Ÿ˜„

solar whale
#

I'll poke at it tomorrow.

#

goodnight!

idle owl
#

Goodnight!

onyx hinge
#

@solar whale yes I built an SDK fresh tonight (the first ESP8266 SDK I built)

#

@solar whale but based on the commit in micropython the breaking update occurred some time ago

#

ummmm something's quite weird

#
'0xc3bfc3bf'```
solar whale
#

@onyx hinge Iโ€™ll compare it to my build environment tomorrow. I just built master yesterday with no issues.

onyx hinge
#

@solar whale I'm not sure what version numbers are useful for me to report about the ESP8266 SDK, I have the gcc version number that I gave above but this is not a gcc version problem

#

>>> struct.unpack('!I', b'\xff\xff\xff\xff') (4294967295,)
OK that's better.

#

some kind of bytes vs strings problem I guess

#

ESP8266_NONOS_SDK-2.1.0-18-g61248df

solar whale
#

Just to check, I just do
cd ports/esp8266
make clean
make

#

Of course after git submodule update โ€”init โ€”recursive

onyx hinge
#

@solar whale sure, but the problem (if I'm not on a wild goose chase) is related to a change in the ESP8266 SDK, which you'd get by (re)building within esp-open-sdk...

#

which most normal people would do once in a very blue moon

solar whale
#

๐Ÿ˜‰ - right after a root canal

#

Iโ€™ll try to replicate it tomorrow.

onyx hinge
#

@solar whale I appreciate it. If you are a github user, comments on the PRs might be more useful than here, just because I'm less likely to miss them. Otherwise, no worries, I'll read here or in a direct message.

solar whale
#

Thatโ€™s fine. Iโ€™ll comment on PR.

onyx hinge
#

great!

solar whale
#

Just want to use same SDK

#

Also did you use STANDALONE = y ?

onyx hinge
#

@solar whale yes

#

well, I understood the docs to imply that STANDALONE=Y was the default

raven canopy
#

in a quick-look at the commits in the PRs, appears those updates were most likely the KRACK fixes based on time-frame. if that's the case, i'll definitely vote for an update...

#

deeper dive; nope, not KRACK related. ๐Ÿ˜„

onyx hinge
#

progress for the evening: built and using own circuitpython for ESP8266 (no particular reason). WIFI, NTP, and OLED working to show accurate time (minutes, seconds, and hundredths), including compensating for the awful accuracy of time.monotonic(), with an error of around 9250ppm (13 minutes/day!)

goodnight all

idle owl
#

goodnight @onyx hinge ๐Ÿ˜ƒ

solar whale
#

@idle owl the rtc version runs under 3.0 as long as I name it main.py -- logging now

manic glacierBOT
#

I tested updating the SDK in my Vagrant Ubuntu system (did not want to go to my main development system, yet). I replicated the issue reported then installed #742 and the build succeeded. Nice!

One concern: applying #742 requires updating the SDK. At least on my non-updated system - tieh #742 installed it fails with:

./../py/../extmod/machine_i2c.c: In function 'mp_hal_i2c_delay':
../../py/../extmod/machine_i2c.c:43:5: error: implicit declaration of function 'ets_delay_us' [-Werror=...
solar whale
#

@onyx hinge see notes in github PR - I saw some difference in the failure reported but your PR fixes it. Note: building esp8266 fails with the PR if the SDK has not been updated.

onyx hinge
#

@solar whale thanks for checking things out. Looks like something will have to be done about ets_delay_us. Any idea how I can get old versions of the SDK for local testing?

solar whale
#

requires some git magic...

solar whale
#

@onyx hinge I think you can just do a git checkout <commit> using the <commit> hash for a commit listed by git log

#

@idle owl its been running for 90 minutes so far.... I'll be out for a few hours - will let it run.

onyx hinge
#

@solar whale I was overlooking the obvious -- I'll give that a try.

manic glacierBOT
river quest
#

LEEKS ... ItsyBitsy M4 Express, it runs CircuitPython โ€“ FAST โ€“ ! CORTEX M4 with 192k of RAM and 512k flash @ 120 Mhz.

timber mango
#

the @ almost gave me a heart attack

agile plover
#

What's with the ping?

river quest
#

and we're working on this photo from the sketch i had made...

agile plover
#

Is that 3d printed?

river quest
#

(in progress, still tinkering)

candid sun
#

i love it!

river quest
#

it's the blinka puppet and a cardboard 3

agile plover
#

how long did that take to make?

#

@river quest

river quest
#

@agile plover the puppet... about a year

agile plover
#

But it turned out to be amazing!

river quest
#

for the history of the universe it did not exist, 1 year was not long at all

#

(and worth a universe to get here)

agile plover
#

@river quest do you guys provide samples for makers to test?

river quest
#

sample of puppets?

agile plover
#

Samples of your products.

river quest
#

we could send out socks

#

oh

#

if someone does code, etc. we sometimes will send products

#

for example, we've sent a few circuitpython boards out to folks

agile plover
#

i would love to test your products

river quest
#

we generally do not need testers for products, we more often are looking for folks who are working on code that would make them better, for example, circuitpython related code, etc.

agile plover
#

i would really love to see how your sensors compare to others

river quest
#

that sounds like a review, not a test

#

we're mostly looking for folks doing code for our new platforms, etc.

#

m4, circuitpython, etc

agile plover
#

i do some arduino coding

#

i could improve on the arduino code which comes with your products also

#

@river quest

river quest
#

it's never been a better time to run python on hardware ๐Ÿ˜ƒ

agile plover
#

yep

#

i mainly specialise in arduino coding

#

@river quest could you dm me?

river quest
#

i'm about to go draw some pictures of snakes

#

(circuitpython, etc, etc)

#

that's kinda my job

#

i am on the clock

#

boss lady needs this done

#

snakes ain't gonna draw themselves'

agile plover
#

@river quest so do you mind sending some products for testing

#

i can suggest improvements, etc

river quest
#

@agile plover stick around here and watch the channel, we often post up what we are looking for, it's mostly circuitpython related to manage expectations

agile plover
#

what about your arduino products?

river quest
#

keeping it on brand and focused ๐Ÿ˜ƒ

agile plover
#

the arduino compatible products you have?

river quest
#

currently, now, on a one-snake-track-mind

#

thems' the slithering orders

agile plover
#

i know some python, so i could possibly do some testing on those products

#

@river quest Hmm, i could possibly test them if you don't mind.

river quest
#

tune in to the channel here for the circuitpython development and needs/issues

#

looking for code contributors and more usually, so stick around!

agile plover
#

ok, do you have anything currently?

river quest
#

the core dev team is here during the week, most of the world is not awake yet

#

tune in!

agile plover
#

ahh, ok, what time is it for you there?

river quest
#

11am ET, NYC

timber mango
#

adafruit scam

agile plover
#

oh, ok.

river quest
#

textmate, scam?

raven canopy
#

@river quest dig the blinka shoot!

river quest
#

thanks @raven canopy the plan is do one for each major release

#

we'll do one for 2, 1 too to catch up

#

we're starting with 3

raven canopy
#

haha. "forge your own path". ๐Ÿ˜„

river quest
#

did you see the poster / sketch?

raven canopy
#

I did. looked through the dropbox.

river quest
#

added some more art over the weekend too

#

limor was speaking in DC so did some mobile work

agile plover
#

@river quest Do you also offer 3d print samples?

river quest
#

@agile plover we're not a 3d printing service co'

agile plover
#

@river quest oh.

manic glacierBOT
solar whale
#

@idle owl still running after 4 hours. I think it is OK - at least on my setup under 3.0

manic glacierBOT
sleek nova
#

Hello, CircuitPython! Is there anyone here familiar with the HT16K33 library in CPy?

raven canopy
#

@sleek nova it's a little slow in here right now, but put your question up anyway. someone may come along and read it. i am "familiar" with the library in that I've read/dissected it. no actual use outside of the Trellis board (which uses the same chip).

sleek nova
#

Thanks, @raven canopy This is what I have going on: I am trying to wire up a 7x7 array of arcade buttons, and I want to control the LEDs in them via the HT16K33 chip. I am having a hard time figuring out how to do this. I am importing the library ht16k33.matrix, and then creating an object: '''ledMatrix = adafruit_ht16k33.matrix.Matrix8x8'''

#

I am not sure if I should be using Matrix8x8 or if there is a better way to access each LED, and I am also not sure how to set an LED on or off using Matrix8x8. ('set_pixel' and 'set_led' raise 'undefined attribute' errors)

#

And I apologize if I am misusing any terminology here -- I am pretty new to all of this.

raven canopy
#

do you have a gist or other posting of your code?

sleek nova
#

I don't. How do I do that?

raven canopy
#

'set_pixel' should be 'pixel', so change line 10 to: ledMatrix.pixel(1,1,1).

#

man. Markdown was giving me fits.. ๐Ÿ˜„

#

were you originally using the Arduino library? i think i remember seeing 'set_' naming in those versions...

sleek nova
#

I was looking through a bunch of github repositories to find the code. Trying again now...

#

Hmm... Now it is not kicking out any errors in the REPL, but it is also not lighting any LEDs...

#

And apparently one of my pieces of code before worked (my daughter just walked up and said, "Why is that one light on?") I have been through so many iterations, that I don't know what it was!

raven canopy
#

hehe. it happens. even with version control, i still mangle things up.

tidal kiln
#

@sleek nova have you wired the LEDs to the ht16k33 same way as the driver expects?

sleek nova
#

I think it is fair to say I have no idea. Right now I have a 2x2 matrix wired, with my neutrals (columns) pinned to C0 and C1 and my positives (rows) pinned to A0 and A1.

tidal kiln
#

the library has hw specific drivers, like matrix and segment, that each derive from the base ht16k33 class. they then do what's needed specific to the hardware (segment or matrix) to set the ht16k33 appropriately.

sleek nova
#

We're in business! I can light stuff up now!

tidal kiln
sleek nova
#

Thanks, @tidal kiln . I big part of the issue I was having is that I don't have dedicated hw for this, but am creating my own array. I think I am figuring it out now, though. Time to see if I can build up to my 7x7!

tidal kiln
#

looks like you are more or less doing the same thing with your 2x2

sleek nova
#

Right. That was to test to see if I could write to it, and then scale up from there.

tidal kiln
#

cool. if you wire like 8x8 schematic, then you can use the Matrix8x8 class from the library

#

otherwise you could just make your own little driver for your display, and have it derive from ht16k33 like the other ones do

#

you'd just need to write your own equivalent to the pixel function

sleek nova
#

Thanks for you help, @tidal kiln and @raven canopy ! I really appreciate it!

raven canopy
#

also, the various Adafruit Learn Guides tagged CircuitPython...

idle owl
#

@solar whale That's good and bad. Means there's something on my end, but if it's still logging for you, it means the project at least works.

#

I really didn't want to solder up another one. It did not go well.

solar whale
#

mine is on a breadboard...still not clear why yours is intermittent.

idle owl
#

Correct

solar whale
#

but if the am2320 does do something nasty, it may be that only a power cycle can clear it. There is no other way to reset it.

idle owl
#

Yeah, Dan suggested running one feather with the Adalogger and another one with the AM2320 and see which one fails.

#

evidently if one of them pulls up, it can hose the bus?

#

iirc.

#

So yeah.

solar whale
#

or try using a bme280 in the place of the am2320 - easier to wire up....

idle owl
#

It's for a guide, so AM2320 is what we're using.

solar whale
#

ah - I guess that would not help ๐Ÿ˜‰

idle owl
#

Thank you so much for testing this though, super huge help. Also the code.py vs. main.py seems weird, but eh, it's alpha ๐Ÿ˜„

solar whale
#

I did not use code.py -- sorry if I confused it. It only works as main.py -- not via manual import of it for me.

#

I tried to add an led blink to it, but it runs out of memory again...

idle owl
#

lol yes it does.

#

It's very much on the cusp

solar whale
#

I was just loading it as am2320_rtc.py and then using import am2320_rtc but it could not load. renaming to main.py worked

#

It is really nice to see the RTC working and logging. I had never been able to do that before.

idle owl
#

Took a lot of fiddling ๐Ÿ˜ƒ

solar whale
#

I am hoping we can eventually pare down the rtc code to provide a subset of features. datetime has a lot in it.

idle owl
#

Alarm code takes up a lot. But Scott's wary of two libs for the same thing.

solar whale
#

or just wait for m4's

idle owl
#

For this sort of project, perhaps. The guide won't wait though, so I'm in a bit of a precarious position with this project.

#

Neat. I just loaded 3.0 on this one, just to see if it would run, and didn't unplug it between, and the I2C is still failing. So that's nifty. It's so HW hosed that all of that didn't fix it. Power cycling now.

solar whale
#

Sounds like the I2C bus is getting pulled by something - I would suspect the am2320

idle owl
#

sigh. Yeah.

#

Seems the likely culprit.

solar whale
#

I tried taking out the analog battery read, but it really didn't help

idle owl
#

3.0 is giving me a memory allocation failure.

#

hmm.

#

fails on the vfs line, which is what it was doing before.

solar whale
#

it did sometimes for me but usually works.

idle owl
#

eh we're doing it on 2.2.4 probably anyway. For now. so if that's how it runs for me, then that works

#

putting it back now. It was entirely for curiosity.

#

Hope it still runs ๐Ÿ˜„

solar whale
#

good luck!

unreal ginkgo
#

Good afternoon!
Iโ€™ve got some other stuff done so I have time to work on my express

#

Iโ€™ve got the lights working so

#

I guess now I confuse myself with sound

solar whale
#

@unreal ginkgo looks like you have all the pieces for plenty of confusion!! Have fun.

unreal ginkgo
#

I donโ€™t have a clue how to set any of this up honestly

solar whale
unreal ginkgo
#

Alright!

solar whale
#

@idle owl is the guide specifically fpr the am2320 with the adalogger/rtc?

#

Have to run - good luck @idle owl

timber mango
#

Hello can someone please give me a summary of what circuitpython is i have seen this but never looked into it

unreal ginkgo
#

i uh
uh
is there a way i can test the amplifier without soldering

timber mango
#

I have no clue whatโ€™s going on in this but yes you can test almost anything without soldering you just need some alligator clips

unreal ginkgo
#

i have those

#

i'm not quite sure how to hook this all up i guess

#

i guess my biggest concern right now is to how to hook things on

#

there's not much
space to put on clips

#

that and there's a lot of places to hook things up and no clue what i'm trying to hook up to the playground express

#

Does this look right?

river quest
#

HOT OFF THE PRESS

idle owl
#

@solar whale For when you're back: Yes the project is about datalogging and then getting the data into a spreadsheet and making a graph.

river quest
#

total time was 15 mins to write the code, show it, upload it and post it here

#

will add the code to github later for learn guide stuff

tidal kiln
#

@idle owl quick scanned the scroll back - r u still trying to get it to work?

idle owl
#

@tidal kiln It fails after a period of time. I haven't done the real troubleshooting yet. It's working right now and it works if I power cycle it after it stops working. I haven't run the logger and the sensor separately yet, I haven't setup the saleae, I haven't done any of that yet. So at the moment the fact that it's still being weird needs to be further investigated by me

raven canopy
#

@deft bay dark theme = the bestest. ๐Ÿ˜„ and, that's a glaring example of the "quick iteration time" espoused around these parts.

#

@unreal ginkgo you may get lucky with those connections. will be flaky at best. for breakouts+header pins, solder is the obvious choice. you could also try the screw+wire+nut sandwich approach, if you have screws small enough.

unreal ginkgo
#

alright

#

i doubt i have things that size so hm

raven canopy
#

loop-n-twist is another approach, but that's pretty much identical to your current connections. like KittenCanaveral spoke about previously, wouldn't want you "wasting" the expensive conductive thread. do you have any other conductive wire available? (old cables make for great expendable stuff; as long as you can strip the wires)

unreal ginkgo
#

dont think so

#

i have the sewable pixel to ring connector but that seems
really ify

#

i have no idea if that would work or not
it's still wires with a safer connection but
idunno

#

i have no idea how many connections i even need on this to the playground

unreal ginkgo
#

This doesnโ€™t seem right but I wonโ€™t plug anything in to the playground yet

unreal ginkgo
#

Anyone?

tidal kiln
timber mango
#

Thanks @tidal kiln

tidal kiln
unreal ginkgo
#

Alright, just wondering
Thank you

#

So can I kinda just
Hook up the speaker to the playground directly and have better output?

tidal kiln
#

you can, but it won't be very loud

#

why are you trying to use an external speaker?

unreal ginkgo
#

I
I donโ€™t know
I wasnโ€™t sure if it could naturally play fancy normal audio files

#

Maybe the files just too long to normally play

tidal kiln
#

the speaker on the CPX uses the same output, so you could just start by using that

unreal ginkgo
#

Alright

tidal kiln
#

that link shows how to play basic tones and audio files

#

if it doesn't work for the built in speaker, then you'd want to figure that out first

tawny creek
unreal ginkgo
#

well i guess my problem is now
how do i get the file i need small enough to fit on the express

#

okay that worked

#

it
it works
quality is
something
but i got it to play

#

now my next problem is
how to get it to play and flash lights at the same time

#

it's loud enough
but wow
that audio quality is going to bother me

manic glacierBOT
#

Fixed a report length bug for HID reports with Report IDs. This did not bother Linux but failed on Windows and MacOS.

gen_usb_descriptor.py:

Added a helper class for creating and using StringDescriptors.

Adjusted descriptor values to match known working examples (e.g., wireless keyboards/mice, Arduino Leonardo). Reordered interfaces. Previously the order was:

Interface Function Endpoints
0 CDC comm 1
1 CDC data 2 (bidirec...
unreal ginkgo
#

i hope i can actually get this to do both at once

#

if i take out the while a.playing it kinda just starts and then just crashes

#

update, trying to do both at once just forces it into safe mode

manic glacierBOT
marble hornet
#

@unreal ginkgo have you tried compiling into a .mpy file ?

manic glacierBOT
unreal ginkgo
#

Iโ€™d like to know how to do that to store the def stuff

manic glacierBOT
tulip sleet
#

@unreal ginkgo not sure what you mean by "store the def stuff"

unreal ginkgo
#

put the define stuff somewhere else to save space i guess

#

im new to all this so i dont know if that's how it works or not

tulip sleet
#

Using a .mpy can prevent memory problems on import, because it will save the compilation stuff. It's also possible to freeze python code into the flash, but that's done when the firmware (the .uf2) is built. We only do that for Circuit Playground Express right now, to have on-board libraries for the on-board sensors. But that's more complicated and you need to be comfortable building CircuitPython from scratch.

unreal ginkgo
#

i uh
alright i guess

#

i'm probably running low on space for code honestly

#

idunno

#

i'm at 247 lines right now

hollow vigil
#

hey guys, i donno if i can get an answer for my question but here it is:
anyone here know about android studio ? if yes, i want to know how to make a new version for an existed project (same package) ? bcz in case something went wrong i can go to the older version.

unreal ginkgo
#

I
Oh

#

My laptop just bluescreened

tulip sleet
#

@unreal ginkgo You can play audio files that will fit in CIRCUITPY - they don't have to fit in RAM.

unreal ginkgo
#

Yeah
Right now my problem is getting the audio files to play and have the lights on the playground flash at the same time without crashing

tulip sleet
unreal ginkgo
#

Alright

tulip sleet
#

can you post the code here or in that issue above?

unreal ginkgo
#

Once my laptop reboots, yeah

#

How much of the code?

tulip sleet
#

just click the "+" to the left and upload the file, if that's ok with you.

unreal ginkgo
#

Alright

unreal ginkgo
tulip sleet
#

@unreal ginkgo Thanks, I'll trim it down by experiment to the minimum crash-inducing case.

unreal ginkgo
#

there's a few other audio files i needed to get in there

river quest
unreal ginkgo
#

but for now it's more of

#

okay the other audio files i need, i need to figure out which are which first, so that'll come after i've gotten this main one working

slender iron
#

@unreal ginkgo @tulip sleet Once I get wave playback going in 3.x I'll make sure it doesn't have that same bug.

unreal ginkgo
#

alright

tulip sleet
#

@slender iron do you think it's fixable in 2.x easily?

slender iron
#

I haven't looked into whats causing it

#

so I don't know ๐Ÿ˜ƒ

manic glacierBOT
marble hornet
#

METRO M4 !!!!!! YAY YAY YAY

manic glacierBOT
onyx hinge
#

ooh I just noticed samd51 has a true rng

manic glacierBOT
#

I did a little research on this. It may be an issue finding report descriptors that will work on all the major platforms. Paul Stoffregen has implemented touchscreen HID support for Teensy. The report descriptor he developed I think appears to work on Windows and Mac without external drivers; it may not work on Linux (or at least Raspbian). Some background here and in other forum posts: https://forum.pjrc.com/threads/32331-USB-HID-Touchscreen-support-needed

slender iron
#

@onyx hinge you can access it through os.urandom the random module uses it as a seed

manic glacierBOT
#

fca9c66 added Status submodule to shared-bindings/super... - sommersoft
9ee4d13 added Status submodule to ports/atmel-samd/comm... - sommersoft
5de8df7 added Status submodule to ports/nrf/common-hal/... - sommersoft
60d6ccc changed spaced supervisor/Status.c line to tabbed - sommersoft
c1c3a79 atmel-samd: changed Status to Runtime; institut... - sommersoft

#

Not-much-of-an-update, update.

After much reading, and comparing to 2.x/ASF3, I'm not exactly any closer. I may have gotten somewhat closer, since I have determined that the previously mentioned calls to EIC_Handler are actually being called during common_hal_pulseio_pulsein_construct and not during the resume call. After seeing that, I started playing around with two things:

  1. pulsein_set_config - I turned off the disabling/enabling of the EIC to set the config. I know that ...
raven canopy
#

phew. weekly GitHub Novel completed... ๐Ÿ˜„

manic glacierBOT
manic glacierBOT
#

Rats. I was looking for uses of i in the loop and missed that, and I should have tested it anyway.

We could store the MUX choice in the pin table. There are some 7-bit fields that could be 4 bits, and a MUX flag only needs one bit to distinguish between MUX_C and MUX_D. Or I could just write some some special-case code. Or we could forget this for now and just document it.

onyx hinge
#

I have a concern about timekeeping in CircuitPython. My project is to build a device that continuously shows the accurate seconds and fraction-of-seconds, using a local NTP server as the source of the accurate time. So a main sub-problem is computing that e.g., monotonic time 1234.567 is actually NTP time ....:54.321. I have an implementation that works pretty well, but the worry is that after the device has been up for some time, it will begin to work less well due to the extremely limited precision of floating point arithmetic in CP. Specifically, if I understand FP in CP correctly, after about a half day of uptime for the device, the monotonic value's precision has declined to 15.625ms (based on a 22-bit mantissa), and it will only get worse as the device is up longer.

#

but there's no API in Python3 that does this, they all operate in double-precision floating point in python3

#

Making the device reboot twice a day might be just fine, as it will quickly sync up to NTP time again, but I wish there were a way to get the monotonic time in two parts, such as seconds and microseconds

#

maybe it would be in keeping with the CP philosophy to relegate this other time API to microcontroller module or something..

slender iron
onyx hinge
#

@slender iron it doesn't handle sub-second precision timing, does it?

#

(my use case is a bit weird because I actually don't care about any interval longer than a minute...!)

#

(but I want to run forever)

slender iron
#

ah, no it doesn't

#

what are you measuring? pulseio.PulseIn can measure pulses better

onyx hinge
#

@slender iron a friend of mine is into mechanical watches. He wants a gizmo that displays the accurate time that he can hold his watch next to and visually tell whether it's gained or lost time since it was set. The time intervals he's interested in are in the second to subsecond range.

#

there's not a pulse to measure, the human eye is involved.

slender iron
#

I'd trust a laptop more than circuitpython

onyx hinge
#

e.g., "that watch I wore today lost a half a second over 8 hours"

slender iron
#

in 3.x at least we don't have the external crystal working so the 48mhz isn't super precise

onyx hinge
#

I agree with that, but with NTP I can assess any systematic error in the local clock and correct for it

#

e.g., I determine that monotonic() runs 225ppm fast compared to NTP

#

or rather, the software does it dynamically

#

Maybe other computers don't suck, but in my usual desktop OS the display of seconds is disabled in the onscreen clock by default, and when you enable it it is awful. Sometimes seconds are skipped entirely. (xfce on debian) so trying to assess a difference of .5s between two devices is not happening.

plucky flint
#

๐Ÿ‘‹

slender iron
#

hi @plucky flint !

idle owl
#

Hey @plucky flint!

#

@slender iron Do you have a link to the driver list?

plucky flint
#

hey hey...

slender iron
#

@onyx hinge ah, that works too

plucky flint
#

Who's going to be at PyCon (in just under a month)..?

slender iron
#

@tulip sleet, @idle owl and I

idle owl
#

Yep!

plucky flint
#

Cool... it'll be ace to catch up ๐Ÿ˜ƒ

slender iron
#

@plucky flint yes! totally!

idle owl
#

@slender iron Yes! Thank you!!

#

@plucky flint And meet you ๐Ÿ˜ƒ

tulip sleet
#

@onyx hinge also many boards don't have a crystal clock, so they are already inaccurate to begin with. And in 3.0 we haven't yet added crystal clocks to the boards that have them

#

you can measure the error but it will probably drift, be temperature dependent, etc.

manic glacierBOT
#

like @l8gravely I want a monotonic time source which doesn't lose precision. In my project, I want to show the seconds and fractions of seconds based on NTP time, but it starts to lose precision as the monotonic() value gets large.

For me, directly exposing common_hal_time_monotonic(), possibly via the microcontroller module, seems like a good first step. I'm not sure whether exposing it as a 64-bit value (restricting it to devices with support for longs) is better, or exposing it ...

onyx hinge
#

It's too late for me to decide to go to pycon this year, but if I stick around the CP community I'll sure be tempted next year!

#

@tulip sleet agreed about the drift and temperature dependence. As long as changes are slow, the NTP algorithm corrects for them properly.

tulip sleet
#

in 3.0 we have turned on long ints, so it will be much easier to deal with large tick values. we hope to leave that on for all ports, but we haven't finished enough stuff yet to know whether we have room on the non-express boards

onyx hinge
#

https://www.ietf.org/rfc/rfc5905.txt down at 11.3. Clock Discipline Algorithm describes the real algorithm. I did something much simpler in order to save implementation space, and as I cap my polling interval at 60s the amount of drift that can occur even with a really poorly disciplined local clock is quite small.

#

whyyyyyyy does MICROPY_OBJ_REPR_D only store 31-bit ints? Not that you'd want to enable it on samd hardware anyway...

slender iron
#

@onyx hinge our current representation is 31 too. it needs that last bit to indicate its an int ๐Ÿ˜ƒ

onyx hinge
#

@slender iron REPR_D is the one which is 64 bits big

manic glacierBOT
#

Fixes #577.

Note that storage.erase_filesystem() does a microcontroller.reset() after reformatting. This is necessary to get the host computer synced up with the filesystem, including both contents and mountpoint name.

The main use of this is to be called from the REPL, since if the filesystem is damaged, it's not likely one can write a file to call this anyway.

I purposely chose a long name to make it less likely to be used casually.

#577 discusses adding `storage.format(...)...

slender iron
#

@onyx hinge ah, now I understand your confusion ๐Ÿ˜ƒ

onyx hinge
#

@slender iron the diagram in mpconfig.h shows about 16 spare bits in the int representation. Maybe too many things became too complicated, trying to support 31- and 47-bit short ints...

slender iron
#

ยฏ_(ใƒ„)_/ยฏ

onyx hinge
#

@slender iron while I've got you on the line, are crashes involving @micropython.viper and similar for optimizing(?) functions of interest to CP or only to MP?

slender iron
#

@onyx hinge we don't promote it so upstream is fine. we'll get them when we update micropython

onyx hinge
#

@slender iron 10-4.

languid sage
#

Hey, back to your time discussion. As I understand it... NTP is derived from WWV or WWVH radio signals, the national standard that is generated from an atomic clock at the US Naval Observatory in DC. Any local implementation (e.g., a crystal, or other known oscillator) won't be as accurate in the long run. But ya gotta get the signal off the radio. I'm not sure what frequencies they (wwv & wwvh) are at but is used to be 2.5, 5, 10, 15, 20... MHz. OBTW, wwv is in Colorado, and wwvh is in Hawaii.

onyx hinge
#

@languid sage indeed, a "stratum 1" NTP server gets its time from some other reference. These include WWVB, GPS, and others. figure 12 of the earlier-linked RFC gives a list. I happen to have a "stratum 1" NTP server in my home which uses GPS as a reference, the sadly-discontinued Laureline GPS. (It has a GPS receiver, a temperature-compensated oscillator, ARM microcontroller, and ethernet interface) There are other similar professional devices, but they are priced way above the $100ish that the Laureline sold for!

languid sage
#

Yea, I understand. HP used to sell a lab-grade nuc clock for many K$. most of us never need that. In fact I haven't worn a watch since my retirement, a dozen years ago.

onyx hinge
#

We all (OK, slight generalizing going on) have pocketwatches now. They just have built in web browsers and can also take phone calls.

#

ooh the laureline design files are online. ugh, altium.

slender iron
#

<@&356864093652516868> Meeting starting in two minutes!

raven canopy
#

Typing sounds. It must be Monday... ๐Ÿ˜„

#

10hour YT vid...

tulip sleet
timber mango
#

here!

idle owl
#

welcome!

timber mango
#

(text only)

onyx hinge
#

no mic,

#

but group hugs to everyone helping me with questions about circuitpython and helping me find existing issues about the problems I'm hitting

#

that means you @slender iron

#

๐Ÿ˜ƒ ๐Ÿ˜ƒ

solar whale
#

@tulip sleet just pulled master and PR 747 - tried to build trinket M0 - got this ```jerryneedell@Ubuntu-Macmini:~/projects/adafruit_github/circuitpython_master/ports/atmel-samd$ make BOARD=trinket_m0
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
install -d build-trinket_m0
python3 tools/gen_usb_descriptor.py
--manufacturer "Adafruit Industries LLC"
--product "Trinket M0"
--vid 0x239A
--pid 0x801F
--output_c_file build-trinket_m0/autogen_usb_descriptor.c
--output_h_file build-trinket_m0/genhdr/autogen_usb_descriptor.h
usage: gen_usb_descriptor.py [-h] [--manufacturer MANUFACTURER]
[--product PRODUCT] [--vid VID] [--pid PID]
[--serial_number_length SERIAL_NUMBER_LENGTH]
--output_c_file OUTPUT_C_FILE --output_h_file
OUTPUT_H_FILE
gen_usb_descriptor.py: error: argument --output_h_file: can't open 'build-trinket_m0/genhdr/autogen_usb_descriptor.h': [Errno 2] No such file or directory: 'build-trinket_m0/genhdr/autogen_usb_descriptor.h'
Makefile:391: recipe for target 'autogen_usb_descriptor.intermediate' failed
make: *** [autogen_usb_descriptor.intermediate] Error 2

onyx hinge
#

@solar whale first guess without looking at anything, you may need to run a "submodule update" to get some changes to the gen_usb_descriptor.py

#

I think that's just git submodule update --recursive

solar whale
#

I did the submoduel update

onyx hinge
#

oh, hm

tulip sleet
#

i forgot I need to do a mkdir for the <board>/gendhr directory. Just create that manually.

raven canopy
#

@tannewt and @Dan Halbert for the constructive feedback on my long-lived PRs. And again, @kattni for churning out guides and code like a tornado. Group hugs beyond that!

slender iron
#

@meager fog any hug reports?

onyx hinge
#

@solar whale @tulip sleet has it

tulip sleet
#

@solar whale not sure why you are seeing it and not me, but I'll experiment.

#

@solar whale if you do a clean first, the qstr generation will create the directory.

timber mango
#

@slender iron hey back

solar whale
#

I did mkdir boards/trinket_m0/genhdr but that dis not help

#

also did clean

timber mango
#

yep great work from dan on getting HID working on m4, kattni+noe+pedro on the trampoline guide, pt for working on the Awesome List for circuitPython

tulip sleet
#

just do make clean BOARD=trinket_m0, then make BOARD=trinket_m0

solar whale
#

I did that

tulip sleet
#

hmm, the qstr generation creates the directory.

solar whale
#

back in master now - not pr747 -- same problem

#

same problem for metro_m4_express_revb

tulip sleet
#

@solar whale what is python3 --version

solar whale
#

python3 --version

#

oops

#

jerryneedell@Ubuntu-Macmini:~/projects/adafruit_github/circuitpython_master/ports/atmel-samd$ python3 --version
Python 3.5.2

tulip sleet
#

make clean BOARD=trinket_m0; mkdir -p build-trinket_m0/genhdr; make BOARD=trinket_m0 for now as a workaround

solar whale
#

that works!

errant grail
solar whale
#

I'll try it with pr747 and see if I can wipe a FS

errant grail
onyx hinge
#

This last week, I got up to speed on building for ESP8266, and submitted a PR for that. I am still working on getting all the fuzzing bug reports from 2-3 weeks ago filed. I did two simple projects, one to help with "intermediate frequency alignment" of radio receivers (generating some analog signals and controlling an AD9850), and one to show accurate time from on the OLED feather wing. Neither is up on github yet; I may be asking for help to turn the NTP stuff into a library for CircuitPython though.

#

+Grammar

tulip sleet
#

@solar whale @onyx hinge aha: the make works for me because I'm doing make -j4 BOARD=trinket_m0 (in an alias). -j4 parallelizes the make. The qstr generation runs in parallel with that python script, and creates the genhdr directory before the python script gets to it.

onyx hinge
#

@tulip sleet for me, make clean ; make -j1 autogen_usb_descriptor.immediate reproduces the make issue consistently. otherwise it may depend on your -j settings and when you last did a 'make clean'.

manic glacierBOT
raven canopy
#

Still working PulseIn; reached the limits of debug I think. Saleae should be delivered Thursday, so that will help. Might pick up an "easy" 3.x issue in the meantime, or focus on some writing/documentation.

slender iron
#

@meager fog any status update?

tulip sleet
raven canopy
#

PS

raven canopy
#

Analog is the big thumb sticks..

onyx hinge
#

On Linux, any USB HID joystick works without a driver.

raven canopy
#

Are we going to have the speed for this? That's a lot of button data to process and send...

#

My speed question is related to catching simultaneous events (stick + button)...

#

Hehe. I didn't mean it like that๐Ÿ˜„

twin mica
manic glacierBOT
raven canopy
#

DotStar isn't affected by that issue, is it?

solar whale
#

I wanted to try itsybitsy since we don't have an "eraser" for it.

idle owl
#
# Move the mouse while holding down the left button. (click-drag).
m.press(Mouse.LEFT_BUTTON)
m.move(x=50, y=20)
m.release_all()       # or m.release(Mouse.LEFT_BUTTON)```
solar whale
#

weird - this time it worked....

slender iron
#

@meager fog we're wrapping up. anything else?

tulip sleet
#

kbd.send(Keycode.A) is the same as kbd.press(Keycode.A); kbd.release_all(). <--- this is new as of this morning in the library

manic glacierBOT
raven canopy
#

Later awesome peoples!!

errant grail
#

Thanks!

timber mango
#

@slender iron woops just got back to desk

#

next time ๐Ÿ˜ƒ

slender iron
#

@meager fog np, just wrapped it up though everyone is still here

timber mango
#

nah

#

all good !

slender iron
#

cool cool ๐Ÿ˜ƒ

onyx hinge
#

[typing sounds]

timber mango
#

some Metro M4 LEEEEKZ for the curious ๐Ÿ˜ƒ

slender iron
solar whale
#

@onyx hinge thanks for the quick fix to the make -- works fine

tidal kiln
#

@tulip sleet thanks. that's it. with a makecode uf2 on it goes straight into bootloader.

onyx hinge
#

CircuitPython generates the horizontal sweep and sends a varying frequency signal into the radio receiver (from AD9850). The scope in X-Y mode shows the frequency response of the amplifier. You turn an internal adjustment to center the peak of the response. (note that the scope's "X" is vertical in the video)

#

human foot shown for scale

manic glacierBOT
tidal kiln
#

that silkscreen on the m4 beta with mosfet is very sweet. made me tear up a little even.

manic glacierBOT
onyx hinge
#

@tidal kiln agreed.

river quest
#

in progress ... enjoy ๐Ÿ˜ƒ

solar whale
#

@onyx hinge @tulip sleet I oull the new makefile update into master then pulled pr_747 to build for itsybitys but now I get the same erros with the genhdr dir missing - the workaroud takes care of it, but should it be working now?

onyx hinge
#

@solar whale that should have worked, and not require to manually 'mkdir' as a workaround.

#

.. grumble

solar whale
#

ii works in master, just not if I then add pr_747

onyx hinge
#

what git command do you use to "add pr_747"?

manic glacierBOT