#circuitpython-dev
1 messages Β· Page 226 of 1
but i think just not connecting them is easiest
Easier than time travel yes π
But would they interfere if I just donβt press them?
OK -- now that I have it running -- I'll play ... thanks
thank you!
is that from master or a local build?
local
there should be optimizations that can be done in the python libs
will push my code once its pieced back together
ok -- is there a font you recomend for testing?
not really. I just picked random ones
ok me too -- that was cherry ...
@solar whale did you get Limor's request/socket updates working? I'm trying the cheerlights demo and getting an empty buffer after a socket read
let me check I -- did the countviewer -- may not have tried cheerlights but I thogut I did -- just a sec
@pastel panther works for me
I don't have an rtspin wired up so maybe that's the issue?
yes -- you need that
well there ya go; I'll have to fix it tonight as it's all bundled up in a case atm and I'm away from my bench
in other news either I'm doing something wrong or the am2320 driver needs some work
hmm
on what board
ooh, lowering the baud rate at least got something back
the am2320 is odd becasue of its wakeup -- I2C scan may not see it
it works ok as long as I don't grab temp + hum too quickly
with what board?
a rev b metro m4
π¬
@solar whale https://github.com/tannewt/circuitpython/tree/rework_displays this is later than the build I gave you and is untested (just got it compiling)
do you have latest libraries?
it's working towards dynamic display support and 8 bit parallel support
gonna go run now since the suns out
back later!
enjoy!
@tough sun ya, pretty recent at least. I flashed it with 4.0. alpha whatever is recent the other day and used the libs I downloaded like a month or so ago?
what errors do you get
I forgot, lemme check; if I remember correctly it was on the "wakeup" read/scan
>>> print("%f %f"%(sensor.temperature, sensor.relative_humidity))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "adafruit_am2320.py", line 136, in relative_humidity
File "adafruit_am2320.py", line 123, in _read_register
File "adafruit_am2320.py", line 110, in _read_register
File "adafruit_bus_device/i2c_device.py", line 102, in write
OSError: [Errno 5] Input/output error
>>>
@pastel panther hmmm -- been awhile since I tried one -- I'll dig it out and see if I can reproduce -- you probpably should file an issue
@tidal kiln okay thank you very much π
will do; I was going to poke into it a bit more to see if I could fix it but I suppose I should probably open a ticket in the meanwhile
@craggy harbor np. good luck.
Thanks! π
@slender iron I dowlnoaded,built and tried your latest rework_displays on my feather m4 -- boots to safe mode π¦
If carter is busy I wouldn't mind taking a stab at it
@pastel panther am2320_simpletest.py (from the lib example) works on my metro_m4_express (newer one) ```import time
import board
import busio
import adafruit_am2320
create the I2C shared bus
i2c = busio.I2C(board.SCL, board.SDA)
am = adafruit_am2320.AM2320(i2c)
while True:
print("Temperature: ", am.temperature)
print("Humidity: ", am.relative_humidity)
time.sleep(2)
@solar whale try this:
print("%f %f"%(sensor.temperature, sensor.relative_humidity))
ok -- just a minute
I just did some more tests and it is ok with a .018 delay between reads but not a .017
>>>
>>> import am2320
23.799996 31.299996
22.699997 31.099999
22.600000 30.799997
make sure you have lates lib -- there were changes made to fix timing -- it does not really read again when you query temp then humid.
ok
@pastel panther sorry -- I was thinking of the DHT11 - am2302 regarding the timing -- not sure about the i2C code -- it is different, but it works on my metro M4
@solar whale just updated the lib and still get the error. You tried with no/very small delay between reads?
I have 2 sec betweeen reads --uses your line to read temp/hum -- you can't poll it taht fast for full reads
you mean because of the sleep in _read_register?
or is it just 'known' that you have to use the driver with a delay between reads?
yea, I had to hold my computer upside down and balance on one foot to try and understand that datasheet
Welcome to AMxx/DHT Funtown! π
Aosong AM2320 datasheet, Digital Temperature and Humidity Sensor, AM2320 datasheet, AM2320 pdf, AM2320 datasheet pdf, AM2320 pinouts
oh hah, I had found an "english" one somewhere
Yeah "the bus is only allowed to hang a product" is an odd comment in a datasheet.
for the "one-wire" mode like the dht11 it say 2 seconds betwen reads bit it is not specified for I2C -- still I don't think the sensor can handle real fast sampling.
especially with its funky wakeup
measurement is completed, the recording temperature and humidity values, then completed a
communication, the sensor automatically goes to sleep; therefore, as long unread sensors
continuously read the second sensor, in the second reading of the temperature and humidity back to
the latest value (minimum interval of continuous reading 2S)```
that is in the I2C section
I think 2 Sec is the limit -- your mileage may vary π
but I thought it would just report the old value, not barf....
wat
I had a hardware random number generator like that: if you read it too fast, it just gave the previous "random" number again.
@solar whale not surprising. I only got it compiling
@main meteor seems like a great opportunity for a security bug
Ya THINK? The US government approved this travesty too!
I have to go for awhile -- am2320 makes my head hurt π
@tough sun awwwwe yesssss
def request(method, url, data=None, json=None, headers={}, stream=None):
@solar whale thanks for the help!
Glad to help -- good luck!
@slender iron I added an mp_isinstance() in my own branch, which does the subclass checking of mp_instance_cast_to_native_base() and just returns a bool. Convenient for arg validation. Will be in my next PR.
With ESP8266 support bring removed in 4.0, is this obsolete?
Great news: I got cp driving the Xbox adaptive controller! Iβll hopefully show it off tonight in show and tell
Thanks @tulip sleet and @split ocean
Fantastic!
Basically they wonβt support composite hid
So I stripped the others out on my fork
I hear @slender iron Is working on something to fix this
Someway to say which profiles are exposed
I'm not working on usb at the moment
I would like to allow dynamic descriptors but its not coming soon
- from me at least
Gotcha
Well we might still wait on a guide until they fix their firmware or we add that π
@pastel panther FYI -- just ran the am2320 test with no delay on my metro_m4 and it works OK - ```
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 4.0.0-alpha.5-120-g573c6d60b on 2019-01-11; Adafruit Metro M4 Express with samd51j19
import am2320
22.500000 30.000000
22.500000 30.000000
22.500000 30.000000
22.500000 30.000000
22.500000 30.000000
22.500000 30.000000
22.500000 30.000000
22.500000 30.000000
22.500000 30.000000
22.500000 30.000000
22.500000 30.000000
22.500000 30.000000
22.500000 30.000000
22.500000 30.000000
22.500000 30.000000
22.500000 30.000000
22.500000 30.000000
22.500000 30.000000
22.399995 30.000000
22.399995 30.000000
22.399995 30.000000
22.399995 30.000000
22.399995 30.000000
22.399995 30.000000
22.399995 30.000000
22.399995 30.000000
22.399995 30.000000
It does not update every sample but it runsimport time
import board
import busio
import adafruit_am2320
create the I2C shared bus
i2c = busio.I2C(board.SCL, board.SDA)
am = adafruit_am2320.AM2320(i2c)
while True:
print("%f %f"%(am.temperature, am.relative_humidity))
@slender iron @tulip sleet @pastel panther, and any other datasheet wizards, can i get some clarification on my understanding of this. in SAMD51 TC->CTRLBSET.CMD register description, there is this tidbit:
The commands are executed on the next prescaled
GCLK_TC clock cycle.
I understand that to mean that if a command is set, the result won't be immediately available (like the very next line of code, in an interrupt handler). for detail, to read the COUNT register it has to be sync'd with the READSYNC command, since the the APB and GCLK are asynchronous.
ya, that's my understanding
sounds right
k. i was hoping i was wrong. π
@solar whale Hmmmmm......
@solar whale I'll perhaps scope it to see if there is something wonky going on with my setup
Thanks for the test
@pastel panther how did you get a CP 4.0 build for the revB board?
I hacked it together from an old commit
hmmm -- do you have any other M4s to try it on?
ya, will do
have you guys ever had issues with CPOL and SPI polarity?
this issue is a bit of a headscratcher for me
https://github.com/atsamd-rs/atsamd/issues/32
here's a screenshot of the sample file, it's obviously IdleHigh
another one I captured myself
I'll have to try a register dump I guess
to make sure cpol is actually cleared
prepare for star flood
Newbie looking for some help again. I have this code that danh kindly provided and works great for 1 switch. when toggle 1 is turned on I get keycode A like I should, the light turns green and when I flip it off I get CTRL SHIFT A and the [5 ] light goes off. So far so good. As you might imagine, I have a bunch of these toggles. As soon as I add anything else, in this case ifr, everything gets weird and things seem random.
Here is my code:
import time
import board
import digitalio
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keycode import Keycode
from adafruit_circuitplayground.express import cpx
kbd = Keyboard()
apu = digitalio.DigitalInOut(board.A1)
apu.direction = digitalio.Direction.INPUT
apu.pull = digitalio.Pull.UP
ifr = digitalio.DigitalInOut(board.A5)
ifr.direction = digitalio.Direction.INPUT
ifr.pull = digitalio.Pull.UP
cpx.pixels.brightness = 0.1
while True:
if apu.value:
while apu.value:
pass
kbd.send(Keycode.SHIFT, Keycode.CONTROL, Keycode.A)
cpx.pixels[5] = (0, 0, 0)
if not apu.value:
while not apu.value:
pass
kbd.send(Keycode.A)
cpx.pixels[5] = (0, 200, 0)
if ifr.value:
while ifr.value:
pass
kbd.send(Keycode.L)
cpx.pixels[6] = (0, 0, 0)
if not ifr.value:
while not ifr.value:
pass
kbd.send(Keycode.I)
cpx.pixels[6] = (0, 200, 0)
@tough pier is this for an aviation related project?
@tough pier I don't think that style of check for toggles will work with more than one, at least as written
@tough pier Once the program gets into one of the while <statement>: pass loops, it's going to stay there until <statement> isn't true anymore, which means it's never going to get down to the checks for ifr until it has determined the state of apu and then the state of apu has changed
If I had to guess at the behavior, it's probably only seeming like it will only react to the behavior of one toggle at a time and will alternate between which toggle it's responding to
to handle more than one toggle, you can't have the while <statement>: pass sections; you'll have to keep track of the state of each toggle and then do something when the current state of the toggle is different from the previous state of the toggle
@pastel panther yes this is definitely an aviation project...
controlling an app on an ipad or something?
@pastel panther actually using cpx to help real world toggles in my f18 cockpit
I assume you don't mean a real, actual f18?
Sort of. It's an f18 cockpit for my f18 sim
That is cool as heck
I saw someone do something similar with an airliner a while back
It is pretty awesome. I see what you mean by the loops. What is the right wY
Somehow I assume a single CPX isn't going to cover all the toggles π€£
let me see if I can find a code example
No, but it'll handle the real important ones
I would be more than happy to help you figure out whatever you want to do hardware wise
but lets figure out the code first
i would use a last_value to compare to. that way it doesn't always send the keycodes.
I know this is a common problem so I'm trying to find something that already exists
something like this
apu_last = None
while True:
if apu.value not apu_last: # we have a new value
if apu.value:
kbd.send(Keycode.SHIFT, Keycode.CONTROL, Keycode.A)
cpx.pixels[5] = (0, 0, 0)
else:
kbd.send(Keycode.A)
cpx.pixels[5] = (0, 200, 0)
apu_last = apu.value # set the new last value
lol. you were!
sure, sure
so that code section would be repeatable for 7 or 8 switchwes?
yes
can be. but understand that the more you add into a single loop, the slower the loop cycles.
I don't expect that 8 switches would be noticeably slow
Ah, I get what you're saying
steps aside
no, not too slow. but, there are faster ways i imagine. like using sets and fancy stuff. π
these switches are activated once an hour or so, so i don't image a slow loop would mattter
ahh. well, yeah, definitely plenty of cycles for that.
Ok, I'm going to load that up and see what happens, thanks
what sim are you using?
you can post the error or code in triple back ticks
```
code/error here
```
it will render like this
while True:
if apu.value not apu_last: # we have a new value
if apu.value:
kbd.send(Keycode.SHIFT, Keycode.CONTROL, Keycode.A)
cpx.pixels[5] = (0, 0, 0)
whoops
(it's a bit trigger happy)
I don't use mu myself; you can't just select and copy?
you can also post a screenshot if you can't figure it out
everything but the error codes
hmm, strange
are the errors in the editor window, or the serial window?
change the not to !=
ahh.. its the # comment after the first if...:
got it
i can't get that syntax error to go away. but i can't for the life of me understand what Mu doesn't like about it. π€·
oh, guess Mu doesn't like not. good call @pastel panther.
python3 doesn't, apparently, at least not in an if:
>>> if True not False:
File "<stdin>", line 1
if True not False:
^
SyntaxError: invalid syntax
>>> if True != False:
... print("hi")
...
hi
>>> if (True not False):
File "<stdin>", line 1
if (True not False):
^
SyntaxError: invalid syntax
huh. looky there.
@raven canopy also code not working
>>> if True is not False:
print("sajattack wins!")
sajattack wins!
i totally forgot the is.
yay
@tough pier is it giving an error, or just not working?
just not working
my original problem was just trying to send 1 keycode and it has snowballed
that's usually how it goes. π
you must go deeper to find your way out
When the switch is off it is in a low voltage state, whn on I'm applying 5v to A1
idk if anyone saw after all the star spam but I'm having a weird issue with CPOL. It's set to 0 (confirmed via an openocd register dump) and yet my logic analyzer is showing active high not active low
@tough pier on a CPX?
yup
if so, i wouldn't use 5v input into it. its a 3.3v tolerant device, and 5v might cause it to be very upset.
I need 5v to make the lighted switch work, when the switch closes it lets the 5 v pass through
also the code was using the internal pullups so the switch should be grounding the pin
ah, ha
do you have any resistors? you could put in a voltage divider. it won't last long getting 5v in.
I have two types of switches one allows voltage to pass these are lighted switches. All the others go to ground
@tough pier you're saying you need to control 5v to go to the light?
I need the 5v output from the cpx to supply voltage to light the led in the switch and that does work fine
How are you supplying 5v? I the CPX can only output 3.3v to a pin as far as I recall. It would probably still be enough to light up an LED, just not as brightly
This is plugged in and powered via usb and VOUT passes whatever the highest voltage is
which is 5 v
yeah, Vout is 5v.
true
I just may need to figure out how to pull the switch to ground
how is it wired now?
can we talk or do we have to type?
we can talk if you can wait a minute
sure thing, lots of typing to convey this wiring stuff
do you have any pictures?
i'm off to bed. i'll be looking for signs of success in the morning! π π€
nite @raven canopy
I gotta go afk for a minute, house+rain problems
@tough pier ok, I'm back; crisis averted
hooray... I'm still trying to sort out the right way to do this
I may have to go afk for a couple too... just not sure when...
I can talk for a minute or two if you're available; we can use the General channel
ok, how do we do it
you have a headset?
I've got a headset aand its oon
you can click on the little gear icon at bottom left, to the right of your screen name
then go to voice and video to test that your headset is working
looks good
once you've checked it, just click on the general channel and you should connect
I did it but didn't see / heart you
I just joined
just to be clear, it's the 'General' channel under the "voice" section which is below the rest of the channels
ahhhh
@tough pier just hit me with a DM when you're back
@tough pier I'm going to have to head to bed before too long
TAHNK YOU EVERYONE FOR MAKING CP SO EASY AND WIDLEY COMPATIBLE. IT IS THE BEST EXPERIENCE I HAVE HAD IN ELECTRONICS !
@marble hornet amen
Is anyone working on a CircuitPython module for the NeoPXL8 (https://www.adafruit.com/product/3975) ?
Yeah, it is. Should we add a standard way to let people easily add custom C functions and put this in there as an example. Maybe some other nifty examples that don't belong in the core.
The learning curve to add modules and functions is pretty high right now, but having a custom module that's present in self-built CPy could ease that. That gives us an easier path for people to contribute things like FFTs and the like.
Then someday we can get dynamic loading :-)
I will re-test and let you know.
quick question is there a guide for putting circuit python on the HCC that was shown in a previous video ?
for the mcp_sram library in the epd how do i check the length of the memory?
I could probably work it in. But @siddacious - you were wanting to try this last time. So why don't you go ahead and take this one.
@cold marlin do you mean the HCC module by Sean Hodgins?
@umbral dagger its fairly low level so no plans to support neopxl8
(if you wanna try, we'd be happy to help!)
@meager fog I'll put it on my list π
@pastel panther yes thats the one, i have 10 of them, would love to port them all to circuit python π
@cold marlin It's certainly possible but it will probably require a JLink
Yup! We are no longer supporting CircuitPython on the ESP8266 because it lacks native USB.
@cold marlin There is a guide that broadly speaking covers how to do it. Let me find it
@pastel panther somone has done it, it was featured in an email about 2 weeks ago, just couldnt any guide on how to follow her foot steps π
@cold marlin Here it is
https://learn.adafruit.com/installing-circuitpython-on-samd21-boards
I've done several custom CP boards including one very similar to the HCC, so I can help if you get stuck
@pastel panther thanks i will look over the directions tonite
Was also curious if anyone ported to STM32 like bluepill, i have a bunch of those sitting around i would love to put to use.
Shouldnt be too hard as someone did port micropython to that board
Not that I know of but I've heard it said that it wouldn't be that hard
right
The hard part is in making sure all the peripherals work and the USB support
i have micropython running on their VET6 variant (https://wiki.stm32duino.com/index.php?title=STM32F407)
oodles of ioo
IO
cool
Do you have a JLink? They're very useful if you don't, and the EDU mini is a great deal for the price
https://www.adafruit.com/product/3571
I used this one Logisaf ST-Link V2 Mini STM8 STM32 Emulator Downloader Programming Unit
@pastel panther for no other reason than the tutorial i followed was calling for it lol.
@cold marlin I think that should work, it looks like it speaks SWD, so you should be able to use it in place of the JLink to load the .bin for the bootloader
@pastel panther cool, i will get it on my todo fun list, and document them both as i have 4 bluepill and 4 of the vet6 boards (and 4 IL tft's to go with those vet6 boards)
Apparently I spoke too soon; it looks like there is a way to upload uf2 using a custom arduino sketch
lol
@solar whale wanna try the new requests?
@meager fog will try this evening -- I did run some tests from your repo a few days ago worked great -- I will submit new post example PR tonight if you want
hey, i;m trying to use the mcp_sram lib from the adafruit epd repo to talk to this:
https://www.digikey.com/product-detail/en/microchip-technology/23LC1024T-I-SN/23LC1024T-I-SNCT-ND/5818675
SRAM Memory IC 1Mb (128K x 8) SPI - Quad I/O 20MHz 8-SOIC
but is library only ever returns 0
Hmm, did you write anything to the memory first?
Ok here's the page on the CIRCUITPY drive and renaming it: https://learn.adafruit.com/welcome-to-circuitpython/the-circuitpy-drive
Also added a comparison of bootloader/CIRCUITPY drives here: https://learn.adafruit.com/welcome-to-circuitpython/installing-circuitpython#whats-the-difference-between-circuitpy-and-boardnameboot-3-22
here is what i have hooked up:
cs to D0
pin2 to miso
pin 4 to gnd
pin 7 and 8 to 3v3
pin6 to sck
pin 5 to mosi
does that sound correct ?
or is this a #help-with-projects thing?
Can someone put me in right direction for some help with some code, I'm using a Circuitplayground Express, need button A to trigger a relay to flash on/off non stop untill button B is triggered , I can get button A to trigger the relay but dont know how to exit that loop when button B is triggered
can you post your code?
@modest atlas are you putting the value low then using the break command ?
@modest atlas One option is to have button b being pressed set a variable that is checked for and break out of the loop when set:
>>> b_pressed = True
>>> while True:
... print("hi")
... if b_pressed:
... break
... print("didn't break")
...
hi
You'll then need to set b_pressed to false once you're out of the loop so it doesn't break out again
(or set b_pressed to the button value at the beginning of every loop)
do you need to do other things after the relay is high or just wait until b is pressed ?
Would like button_A to trigger the relay on and off forever untill button_B is triggered
Sorry stepped away from computer to share my code so far
And after button_B stops the relays from "flashing" reset and look for button_A again
apin = input blah
bpin = input diff blah
relaypin = output diff diff blah
relaypin.value = 0
while True:
if pina is pressed:
turn relay on
elif pinb is pressed:
turn relay off
``` is that what you are thinking ?
sorry for delay
Yes but would like pina to flash on and off
@solar whale yah if you want to try to add POST example back, you should be able to use the plain adafruit io API now!
Hi, I am having some trouble with circuitpython globals
I have a function that tries to update the values, but when I print them up, they are not updated
figured it out
my trinket M0 seems to run a different program when connected to the computer than when powered with a USB connected power
@broken blaze That is certainly strange. Are you using circuitpython? Can you share more details about the programs that are running in the different scenarios?
@modest atlas
apin = input blah
bpin = input diff blah
relaypin = output diff diff blah
relaypin.value = 0
flash = False
while True:
if apin is pressed:
flash = True
elif bpin is pressed:
flash = False
if flash:
# toggle relaypin
# maybe some time.sleep(...) here?
@broken blaze my brothers name is Matthew Warren lol
it's pretty close to the original sample code that came included on the board. just runs through the color wheel on the LED.
π there are a few of us out there
@solar basin That's about right but in the if flash block you'd need to check time.monotonic for elapsed time to know if it's time to toggle; sleeps will interfere with the button checks
when it's on a USB for power it jumps through some colors and then does some quick white blinks
status light shows solid green in either case
@pastel panther that works too
Trying this now
I was mostly pointing out that time might be a concern without taking away the adventure of figuring it out π
@broken blaze Unfortunately I have to run but Making sure you're on a recent version of CP is a good idea, and posting the code here in a backtick block will help others identify any potential causes of the strange behavior.
You can post code in a block like this:
```
code here
```
will get rendered like
code here
we really need a bot to post the code block example
import board
from digitalio import DigitalInOut, Direction, Pull
import neopixel
button_A = DigitalInOut(board.BUTTON_A)
button_A.direction = Direction.INPUT
button_A.pull = Pull.DOWN
button_B= DigitalInOut(board.BUTTON_B)
button_B.direction = Direction.INPUT
button_B.pull = Pull.DOWN
pixels = neopixel.NeoPixel(board.NEOPIXEL, 10, brightness=.2)
pixels.fill((0, 0, 0))
pixels.show()
def flash(count, wait):
for i in range(count):
pixels.fill((255, 0, 0))
pixels.show()
time.sleep(wait)
pixels.fill((0, 0, 255))
pixels.show()
time.sleep(wait)
def stop():
pixels.fill((0, 0, 0))
pixels.show()
blink = False
while True:
if button_A.value: # button is pushed
blink = True
elif button_B.value:
blink = False
elif blink:
flash(100, .1)
still cant exit the loop with button_B
@modest atlas the check for button press happens only between calls to flash, so a full run of flash happens then the button is checked for a microsecond and then another full run of flash
@modest atlas also, in elif blink I think you want just if there
strange. I just cleaned out some unused imports and deleted some of the setup of input/output lines from the sample code I wasn't using. and it fixed the issue
maybe the powerbank wan't giving it quite enough voltage to run properly
@meager fog having a lot of trouble getting the imports to work with the new ESPATcontol examples -- how should it be installed?
@solar basin is there away around that
@meager fog sorry -- I'm completlety confused trying to get teh examples to run -- imports keep failing - do you copy the adafruit_espatcontrol folder to your board or just the individual contents -- iI tried both, but keep getting import errors.
Want the flashing of the relay to stop soon as button_B is trighered
@modest atlas incorporate the blinking code into the while loop... it's a bit more advanced, but that's probably what I'd do
You could put checks in the flash function too, but that starts to get a little more messy perhaps.
I haven't tested this, but here's an attempt to do it with time.monotonic(): ```blink = False
state = False
next = 0
blinkrate = 0.1
while True:
if button_A.value: # button is pushed
blink = True
if button_B.value:
blink = False
if blink:
now = time.monotonic()
if now > next:
next = now + blinkrate
if state:
pixels.fill((255, 0, 0))
else:
pixels.fill((0, 0, 255))
pixels.show()
state = !state```
@main meteor nice, exactly π
Might need to add some code to turn the pixels off when button B is pressed if that's desired
@main meteor IT IS
@solar whale what are you getting?
@meager fog I'm getting it sorted out, but have to add from adafruit espatcontol to many of the imports
Do you copy the folder or its contents to your bioard?
ok got webclient and cherelights sorted out -- back on track
yup -- just add from adafruit_espatcontol to every import -- working now
@main meteor im lost
@solar whale yay - if you can submit a PR - i forgot to fix tose up
@meager fog np - I'll do it when I suubmit the post example.
thanx
Um, lost how?
Does the WICED board work with CP?
the M0 will work, but no comms with the WICED chip. its basically a Feather M0 when using CP.
Better off with the Argon then?
yeah. jerryn has gotten it to work using the new AT commands stuff.
Right
@meager fog seems to be a bit of a mismatch between these two listings: https://www.adafruit.com/category/945 and https://www.adafruit.com/category/814
Adafruit Industries, Unique & fun DIY electronics and kits : Wings - Tools Gift Certificates Arduino Cables Sensors LEDs Books Breakout Boards Power EL Wire/Tape/Panel Components & Parts LCDs & Displays Wearables Prototyping Raspberry Pi Wireless Young Engineers 3D printing N...
Adafruit Industries, Unique & fun DIY electronics and kits : Wings - Tools Gift Certificates Arduino Cables Sensors LEDs Books Breakout Boards Power EL Wire/Tape/Panel Components & Parts LCDs & Displays Wearables Prototyping Raspberry Pi Wireless Young Engineers 3D printing N...
Confused me, I couldn't find the Prop-Maker in the first list
@solar basin Email support@adafruit.com to let them know about your trouble finding that FeatherWing. There could be a reason for the difference, but if not, it's good to let them know so it can be fixed.
@solar basin Argon or a Feather M4 and a ESP32 breakout
I've had success with an argon, I know jerryn's adafruit-io-connected-particle was (is?) successfully updating a feed
@slender iron I'm not sure if the webhook on CircuitPython is working or not because I tried to test it by clicking "Redeliver" on a previous payload delivery, and it's failing to deliver. But it occurred to me that it maybe that you can't redeliver an old payload on a new webhook. So I was going to ask if you cared if I deleted the webhook and recreated it, but now I'm thinking maybe we wait until there's an actual trigger and see if it fails at that point. I'll keep an eye on it for now. If it fails on a new trigger, I want to try recreating the webhook at that point.
webhook for what? RTD?
Yes.
I got a bunch of emails telling me to update them. haven't read the actual email yet though
The email is RTD said it had to be reconfigured because of GitHub services being deprecated. There are simple instructions which I followed. But I think it needs a real trigger to try to send the payload again.
k, I don't mind waiting on it then
I'm focussed on display atm
That's fine, I wasn't expecting you to do anything with this except give me the ok to do something with it. But now I want to wait, so that's where we're at.
@solar basin yup! lots of progress
you can connect up a display from circuitpython now
Nice!
want a build to play with now?
@slender iron when you mention connecting up a display from CP, is that a CP equivalent of what you're doing for example in the hallowing board.c? As in I'll still have to feed it the init sequence using send?
the init sequence is passed into the display constructor
should be able to subclass it to encapsulate it though
is that on your fork or has it made it to master?
π
I have some other stuff to take care of, just curious
kk, hoping to PR tonight or tomorrow
coolio, I'll keep an eye out
cool cool
will need help creating the drivers for the displays
will certainly have bugs to run down too
just found rework_displays π
thats the one!
its pretty fresh
fixed up nrf and using board.SPI
@pastel panther https://gist.github.com/tannewt/607dbda68d5cbd202d9d62e049c7bd16
@slender iron I would love a build π
for feather m4?
Yes sir
lol
just pushed the latest
feather m4
the gist I posted earlier should work as a test
I'm off for the night. looks like I have more build issues to run down tomorrow
π
Night @cosmic fractal
night, thanks for the testing
@idle owl @slender iron I don't understand what RTD is complaining about. I checked all the webhooks several weeks ago when I was doing travis.
A small number were wrong, but most of them were right and being delivered.
E.g., one of the repos we got email about:
If you edit that webhook, you can see "Recent Deliveries":
looks ok to me
... ok, I'm seeing incorrect URL's for at least some. I'll fix what I can
i was going to mention that based on that screen shot, but i have zero understanding on the "admin" side of RTD & GH. π
@raven canopy turns out I just found one or two bad URL's. Most are fine but are still listed.
Is there currently a way to read bitmap images from the file system and have access to the image data itself on non-Hallowing devices such as the Feather M4? I figured out displayio is not available on that board.
@gilded cradle https://github.com/adafruit/Adafruit_CircuitPython_ImageLoad/blob/master/adafruit_imageload/bmp/indexed.py
Thanks @slender iron
In the example, it uses displayio. Will it work without that?
I think I get it now. I'll have to write my own bitmap equivalent.
@gilded cradle I might have something that can help; I wrote something a while back to read in BMPs and return the binary format that at least some adafruit_rgb_display displays can use
it's a total hack and maybe buggy but it generally works.
That's what I need
I'm working on the display driver for the RA8875 and needed a good stream to test fast drawing
Perfect. Looks like it works for 16 bit bmps then
ya, I think so. It's been a while
Yeah, just at a glance, that what it appears
Which is what I needed
Thanks so much
I was running in on the micro itself but with some work it could probably be ported to run in normal python
np; hopefully before too long displayio will have this and more
what about CP?
pardon? I was running it in CP on my m4 and then writing the binary output to the flash
Oh, ok. I don't need to port it at all then
here is the script that was using it
You really shouldn't have to pass in a display but when I tried to factor it out I must have had a bug because the bins started blowing up in size
like I said, total hack
I was about to do a total hack myself and write something for the Hallowing that output a raw bitstream to a file, move it to my feather m4, and read that in .
sometimes you just gotta do what you gotta do π€£
Yeah π
<insert comment about hacks becoming production code>
Thanks again for your help
no problem, glad to help
no one should have to stare at countless versions of the same .bmp skewed, upside down, mirrored or otherwise messed up
lol
That said, when it finally works it's glorious
True
I think as is it's set up for BGR so you may have to tweak the arguments to the color565 call
Ah, ok. Thanks
@main meteor good morning! iv seem to get more of the code you helped me with yesterday , but it doesnt seem to understand the state = !state
Ah, the ! operator is shorthand for "not". In other words, it change "true" to "false" and vice versa.
I did goof on that, however: that's the C way to say "not". The correct Python form would be state = not state
Did that variable get initialized? I was wondering about that yesterday, but I'm still pretty new to Python
I think I had a state = False to initialize it before the loop. If not, yes, there should be an initialization to a boolean value
@meager fog FYI - I am getting a lot fewer errors when I connect my ESP32 to an nrf52840 (feather or argon or xenon) then when I use a samd51 (feather_m4 or metro_m4) are you seeing lots of errors/retries with the M4? Just an observation- the errors are mostly when looking for the responses to the AT+CIPSEND commands -- it just times out. It works some times then I get a string of failures and it eventually makes it through. Just curious if you see the same thing.
Sorry about that error, I'll often hang out here while half-listening to the endless meetings at work, so I sometimes post incorrect code while trying to be helpful
it helped me a ton
import time
import board
from digitalio import DigitalInOut, Direction, Pull
import neopixel
button_A = DigitalInOut(board.BUTTON_A)
button_A.direction = Direction.INPUT
button_A.pull = Pull.DOWN
button_B = DigitalInOut(board.BUTTON_B)
button_B.direction = Direction.INPUT
button_B.pull = Pull.DOWN
pixels = neopixel.NeoPixel(board.NEOPIXEL, 10, brightness=.2)
pixels.fill((0, 0, 0))
pixels.show()
blink = False
state = False
next = 0
rate = .1
while True:
if button_A.value: # button is pushed
blink = True
elif button_B.value:
blink = False
pixels.fill((0, 0, 0))
pixels.show()
if blink:
now = time.monotonic()
if now > next:
next = now + rate
if state:
pixels.fill((255, 0, 0))
else:
pixels.fill((0, 0, 255))
pixels.show()
state = not state```
@tulip sleet It says that the old configuration will continue to work until 31 January 2019, so successful deliveries currently do not necessarily mean it's configured properly for the changeover. That said, it also may mean it's fine and there's something else making RTD think it's not configured properly.
@idle owl - I think it may be because of this:
https://readthedocs.org/accounts/social/connections/
I'm going to disconnect, and it should continue to work.
Ok.
Pretty confusing. And they are listing all the "broken" projects at the top of every page, which means you have to scroll down to see anything.
I think they're supposed to be linked somehow, but I'm not sure what that means with the new config.
I think that's a "GitHub Services" link, which is what's being discontinued. But we have the webhooks all set up as well, so they are probably just reporting all the existing projects that fall under "Connected Services", and not noticing there's a webhook in use (which isn't set on their side anyway).
Could be, yeah.
I have a student in my class whose Metro Express just stop working in the middle of a project. The on light comes on, but not the #40 Neo light. Also, the computer cannot see it. Help please!
@half pendant have you tried getting into bootloader mode?
you mean pushing the reset button twice?
yep. and then getting the METROBOOT folder
nothing happens when I do that. Still no light except the ON light.
are other boards available?
Yes, I have several that work just fine.
what was the last thing done to this board before it stopped working?
As a class I had the students create the breadboard layout to using the A1 pin to read photocell through a 10K resistor. I'm not sure exactly what the student did, but at some point the board stop working...
hmmm. maybe electrical.
use one of the other boards that works and try getting that into bootloader
use the same computer / USB port / USB cable, etc.
idea is to narrow it down to the board vs. something else
will that erase any data on the board?
no
okay it successfully put my board into bootloader mood
@half pendant what version of metro is it? m4? m0?
mo
try bootloader again with the problematic board, just to verify
Just tried it with the same USB port and cable.... still nothing on the bad board.
do you have a multimeter?
unfortunately not
any chips hot to the touch?
"on light" = the little green one that's labeled ON?
was power only via USB port?
yes
i tested it later from my 9V battery via the DC Jack but that was after it was not working
the computer connected is a old Windows 7 with only Mu open
the computer connected WAS an old Windows.....
for the photocell project, you had them setup the photocell and 10k resistor as a voltage divider going into A1?
yes. they also had a LED with a 220 ohms resistor on the other side of the breadboard hooked up to the Metro through a digital pin
did the students do the wiring?
yes, so I'm not sure exactly what they did
π¦
there are many ways it could get zapped
esp. with 5V available - the core runs at 3.3V
@slender iron I just tried you latest rework_displays, but there is not bard.DISPLAY -- ?? ```
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 4.0.0-alpha-1709-g96e2c717f on 2019-01-18; Adafruit Feather M4 Express with samd51j19
import pyportal
fade up
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "pyportal.py", line 30, in <module>
AttributeError: 'module' object has no attribute 'DISPLAY'
oh! I do see now that they pinned the photocell directly into the RST pin instead of 3.3V . Would that do it?
@solar whale you dynamically hook it up now
it builds
just saw that -- trying it now
board.DISPLAY will only be for boards with a built in display
@half pendant not ideal. was the reset button ever pressed when that was connected also?
good - I ran into an issue that D9 was claimed after reboot on the old version
ya, think pin claiming is more complicated because displays live until you call displayio.release_displays()
cute little red box in upper left of screen -- is that wyhat I should see?
other stuff flashed by quickly
@slender iron oh wait -- there was a blinka there when I rebooted but not when I ran the code???
π
red box is the code
blinka is after your code finishes
(where we can put error messages and other stuff)
thats why the lifetime of display objects is weird
OK - but I don't see the blinka until I do a Control-D --- not when the code ends
I moved the pin from the RST on the Metro back to the 3.3V and then put it in bootloader mode. It works fine now.
Thank you!
oh. it was still connected? yah - it was probably just holding the board in a reset state.
awesome. glad that's all it was. π
glad to know what to do in the future if that happens again.
yay! glad you sorted it out @tidal kiln and @half pendant
@solar whale i have some esp32 news
??
@solar whale hrm, may need some more tweaking
@solar whale good news - i got the 'arduino' SPI slave wifi code to work on the ESP32 with the arduino C library
which means much faster, more stable, less memory manipulations
@slender iron I have no idea what your code example is doing π
cause its all over synchronous SPI instead of async AT command nonsense
bad news - i wont be doing much more work on the UART AT interface
cause i want to port the SPI code to python and use that
so its sorta in statis - i think its in a good spot, but i dont think we'll get mqtt or any lower level socket stuff working well without a lot of care and feeding. so requests may be it
and...the argon doesnt seem to have enough pins connected to use SPI :/
@meager fog thats too bad but at least the current AT works great on the argon...
its still there for you and others to hack on! just wont be getting a lot of attn from me π
no problem -- thanks for getting it going!
do you have the same issue i am seeing with the M4's -- lots of errors?
the nrfs run so much better
possibly somthing in the samd51 uart that is different
Looking forward to the alpha release of the SPI version -- good luck!
@slender iron just to clarify -- when I run your test code, the screen flashes white then I see the red box and it says sleeping and the code exits with red box on screen. When I reboot (control-D) I see blinka!
ya, could be a bug, does the red box come back?
I see blinka between the whit flash and the red box -- no after reboot -- just blinka -- the code is not running -- I just run it once manually -- not in code.py
did you mean to run it as code.py
@half pendant We have an educators role on this server, if you'd like to be added. It doesn't create any obligations or expectations, it's simply there to make it easier for educators to find each other if they want to discuss education related things etc. Your username would be highlighted in yellow and you'll show up in the "educators" list on the right side of Discord. Let me know if you'd like to be added. It's absolutely fine if you'd rather not as well. π
@slender iron is there something that describes the displayio API -- or just an overview of whats going on... only if its at your fingertips ... don't spend time explaing it now.
@slender iron @solar whale when I tested it I got (and still get) the desired outcome. Red box while running blinka when done
hmm - @solar basin what CP build did you use?
@slender iron I still get weirdness on x = 0. Was trying to compare the init code you sent to what's in adafruit_rgb_display
@solar whale the one he posted yesterday evening
ya, I see that too. been trying to ignore the small issues for now
ah -- I'll try that
@slender iron makes sense, if I figure anything out I'll let you know
There are next to no differences in doing a diff (the rgb lib version doesn't have sizes which I'm confused by) but I pulled up the datasheet on adafruit.com and checking the actual values now
ah makes sense
its correct on hallowing (st7735r iirc) but not ili9341
okay
weird -- same result with that .uf2 -- red box until I reboot.
@solar whale the display has memory so its possible what you see was sent before the reload/reset
just trying to understand how you are running it -- I copied your code to display.py and put it on the baord -at REPL I import display --flashes blinka then red box -- get blinka on reboot. If I rename it to code.py -- I see red box then blinka stays after it ends
@slender iron on the note about the display having memory, I have this 240x320 (portrait) image that I've been rendering with the rgb_display lib (I saved the image in the binary format that the screen expect and read it directly from sd to screen) which I know to be in RGB format, but once the initialization code ran that you sent, it turned blue. So I think you had previously been initializing the screen in RGB but the color conversion code is swapping them, maybe?
OK -- then it works as planned !!!
aha! lol
@solar basin ya, there are color issues atm
I was trying to sort it out with the blinka colors which are hardcoded but I couldn't understand it
@slender iron makes sense
@tulip sleet I think you broke breaking the build: https://travis-ci.com/adafruit/circuitpython/jobs/170920514#L2008
@slender iron ah i see I need to && the echo and figure out some other way of saving the state
groan
i have a couple of ideas; rather not switch to python right now
kk, whatever works is fine with me
maybe i'll change my mind if it gets too frustrating
π
Doing some command ; echo $? > status hid non-zero status from travis. Save the status and then use exit to simulate the command failure.
First push has a deliberate error to test this.
hey, i;m trying to understand some of the nvm module (started going through c stuff)
#ifndef SHARED_BINDINGS_NVM_H
this is in inti.h
i'm curious what SHARED_BINDINGS_NVM_H turns into as it is being compiled
the file is in shared binding/nvm and it is an h file
i'm curious about it's purpose from where is it including stuff?
@marble hornet that line is used to make sure the file contents are only included once
In the C and C++ programming languages, an #include guard, sometimes called a macro guard or header guard, is a particular construct used to avoid the problem of double inclusion when dealing with the include directive.
C preprocessor processes directives of the form #includ...
hey all - I'm getting a Purple LED on an ItsyBitsy m0 and it won't show up as BOOT or CIRCUITPY, is it bricked?
(never got a purple LED before on it..)
This makes displays much more accessible by allowing them to be dynamically created. They have unusual lifetimes because they live through reloads so they can display error messages. To release them you must call displayio.release_displays().
This PR also splits the display bus mechanics from the display commands and adds 8 bit parallel bus support for faster pixel transmission.
@prime flower it's possible, though I don't think so. I thought I had bricked an ItsyBitsy M4 before, but I just needed to reflash the bootloader. IIRC, the light flashed for a moment when plugged in and then went out. I just looked through the circuitpython source and see a purple light represents VALUE_ERROR, though I'm not sure exactly what that means.
@slender iron Of itself?
explain what you mean
SHARED_BINDINGS_NVM_H is a macro that we only check whether its defined or not
@prime flower the led is set to purple when the bootloader is about to jump to the application, but double-clicking is purple too?
#400040
how would one nuke their submodules from orbit? Mine don't like the state they're in and git submodule update --recursive complains about a missing commit in tinyusb and status still shows some deltas for the other submodules
git sync; git submodule update --init --recursive ?
no, it just makes sure the URL in .gitmodules matches what's in the directory
it's not git fetch or git pull
~/micro/circuitpython$ git sync
git: 'sync' is not a git command. See 'git --help'.
i have an alias that does all that
good call
I know this question has come up again; is there a "FAQ" bot that we can make spit out answers?
I think someone made something like that once; one of the young users
This does seem to fix "breaking the break the build" checking. There are errors in the first subjob from mp_map_t issues; I didn't attempt to fix those. The other subjobs are ok.
I originally tried:
- some_long_command ; S=$? ; echo $S > status ; exit $S
but that causes the job to exit immediately due to the exit. You have to run the exit as as subshell:
- make -C mpy-cross -j2 ; S=$? ; echo $S > status ; (exit $S)
was this working before - did you just try to update the bootloader?
you can connect a j-link to it and dump the bootloader section and compare it with a good one. Not sure it's worth it if this was spontaneous
@tannewt Or you could just cherry-pick this into your PR.
This makes sense for a host of reasons - for sure everything Sommersoft said. Including updating that page as part of the process for adding a library to the bundle would save us SO much work in keeping up that page. As well, having docs setup for the bundle is an excellent idea, as we could eventually move instructions for contributing to documentation included in the bundle in addition to the guide.
I think there is the possibility for a loss of cohesion in terms of the project as a whol...
I see you're setting the direction to OUT for the 8 data pins, but you don't set WRCONFIG to be the equivalent of DRIVE_MODE_PUSH_PULL. Should that be done explicitly?
Not sure I understand here. You can't use the top 8 pins in a port? If that's true, could you you put a comment in about it?
It looks like you can do MP_ARG_REQUIRED | MP_ARG_KW_ONLY, so you don't need to check explicitly below if you set the MP_ARG_REQUIRED flag.
Example of this is in ports/esp32/network_lan.c.
@tulip sleet this occured when I tried to burn the bootloader
so the bootloader may be half burned, or something. Also make sure you were using the right .bin. you can dump flash and compare it with what you expect.
Is it possible to use Visual Studio Code with CircuitPython and the Adafruit Circuit Playground Express? I've not been able to get the serial monitor to show inside VS Code and saving the file doesn't seem to cause playground express to reload.
@tulip sleet yeah i have a feeling you're right
There's a post you can try
I use VS Code, but haven't bothered with setting up the serial monitor yet, for now I just use Mu for that as silly as it sounds lol
The spi object needs to live longer than the heap because it may be used by a FourWire between VM runs.
I use VS Code as well but I'm using screen for serial stuff. I should probably get off my butt and use a built in one
old habits die hard I suppose
Can you just add a comment about that? Thanks.
We do actually change a pin to indicate its a command but we could always assume its the first. I'd rather not change it though because it matches the Arduino format. (Here is an example: https://github.com/adafruit/Adafruit_ILI9341/blob/master/Adafruit_ILI9341.cpp#L106)
I'd rather not in this PR. It already has a lot of extra stuff in it.
That's a good reason!
I'd rather not in this PR. It already has a lot of extra stuff in it.
No real reason. I'm likely to change this all soon to make it faster so I'd prefer to just leave it as is.
I think I was confusing myself by thinking ahead to 16 bit ports. Removed for now.
Ok, please take another look.
Still can remove checks for width and height below at line 107 (and probably remove the variables entirely).
Is there currently a way to set an interrupt and define an interrupt handler in CP like there is in C?
@gilded cradle not in CP
there is in MicroPython, but we don't support it in CircuitPython. This is a subject of active discussion: https://gist.github.com/dhalbert/162d496e0f146eec2cecb60c4a0de4c9#asynchronous-programming
Ok, thanks
it's a topic of much discussion
Thanks, I'll stop pursuing it then.
Anyone have insight on this: ```>:make V=2 BOARD=feather_m4_express clean
rm -rf build-feather_m4_express
:make V=2 BOARD=feather_m4_express
make: *** No rule to make target 'lib/tinyusb/src/portable/microchip/samd51/dcd_samd51.c', needed by 'build-feather_m4_express/genhdr/qstr.i.last'. Stop.```
I just synced up for the first time since 4.0 alpha 3
The Makefile & tinyusb filenames are out of alignment
git submodule sync; git submodule update --init --recursive
did a forced submodule sync & recursive update
ah.. not with --init
@tulip sleet same
if your merge from upstream was not a fast-forward, the checkouts you need in the submodules might be out of sync. That happened to someone else a few dyas ago.
That's possible..
i cloned their repo and some submodule was stuck at an older commit. It had been remerged and so wasn't up to date, because the revert to an older commit was accepted as the "right" commit.
That's what git submodule reports for tinyusb (which is related to the problem I'm seeing at the moment)
@slender iron https://travis-ci.com/adafruit/circuitpython/jobs/171576047#L1374 travis fail
yup on it
but I thought you fixed that??
coverage builds different than non-coverage π
@umbral dagger
~/micro/circuitpython$ git submodule status lib/tinyusb
5804e56e3c2ab4480bf72d94d997f769a645af47 lib/tinyusb (legacy-736-g5804e56e)
@umbral dagger I had to look at another clone and carefully compare the commits, then check out the right one.
i just did a fresh clone and got the same hash
I did a fresh clone and moved my changes over... rebuilding now
I've been seeing this message for a while now when building, but it doesn't seem to keep the build from finishing successfully; is this expected?
../../shared-bindings/usb_hid/__init__.h:33:23: warning: size of 'common_hal_usb_hid_devices' differ from the size of original declaration [-Wlto-type-mismatch]
extern mp_obj_tuple_t common_hal_usb_hid_devices;
^
../../shared-module/usb_hid/__init__.c:129:16: note: 'common_hal_usb_hid_devices' was previously declared here
mp_obj_tuple_t common_hal_usb_hid_devices = {
@pastel panther that was fixed in gcc 7.3.1, so if you're using an older version, you can upgrade
ah, good call, thanks.
where did you get your toolchain? I"m using ubuntu, and this ppa: http://ppa.launchpad.net/team-gcc-arm-embedded/ppa/ubuntu
I think brew will get you 7.3.1 if you upgrade
With the HID Gamepad library, is there any way to specify the number of buttons that will be used?
It by default shows 16 buttons and 4 axis.
@wary matrix no, it's fixed by the HID descriptor that describes the gamepad. But you can always use fewer, just not more. Do you need more?
No, I am only using five buttons. It is also showing up as two HID devices, one that is responding to my input, and another that I have found no way to change.
the board supplies a keyboard, mouse, gamepad, and "consumer control". The last is things like volume control and play/pause buttons. These are fixed for now. In the long run we are thinking about how to allow user-specified HID devices in boot.py, but that's a ways off
Okay, it is not a problem in any way, I just thought it was strange. Thank you!
it's like a whiz-bang mouse/keyboard/gamepad/multimiedia keys all in one. yw!
hmm, brew doesn't think my arm gcc is out of date
@pastel panther are you using brew cask?
do you have to do brew cask update or something like that?
that's what I tried and it's saying it doesn't need to be upgraded
the frustrating thing is this:
~/cptest/ports/atmel-samd$ brew search gcc-arm-embedded
No formula or cask found for "gcc-arm-embedded".
Closed pull requests:
Delete gcc-arm-embedded.rb (https://github.com/Homebrew/homebrew-cask/pull/56802)
Update gcc-arm-embedded to 8-2018-q4-major (https://github.com/Homebrew/homebrew-cask/pull/56480)
Update gcc-arm-embedded to 7-2018-q2-update (https://github.com/Homebrew/homebrew-cask/pull/49268)
<truncated>
like my cask definition is out of date
7-2018-q2 is what you want.
but do you need to update the local cache of aavailable casks? I don't use mac so don't really know
I assumed a brew update would do that but I suppose not
apparently that's not a cask command
brew cask fetch shows it downloading the old files
suppose you say brew cask upgrade gcc-arm-embedded
you can do brew cask outdated
https://github.com/Homebrew/homebrew-cask/blob/master/USAGE.md is what I'm looking at.
~/cptest/ports/atmel-samd$ brew cask upgrade gcc-arm-embedded
==> No Casks to upgrade
This ILI9341 init sequence is kind of cryptic. I feel like I don't have the right datasheet
@solar basin I think maybe we were discussing this and someone said there are undocumented init commands. The drivers are the ground truth.
@pastel panther I wish I could tell you more. kattni or tannewt use Mac regularly, but they are offline now.
@tulip sleet Thanks for the help earlier!
did it work?
I got a fresh/up-to-date clone
submodules are not the greatest
But, yes, that fixed the problem.
"this piecrust is burnt; I'll throw it out and get a new one"
instead of scraping the burnt parts off π
Sometimes it gets too burnt for that and the whole thing tastes smokey
Garsh darn this insufferable program! I'm done with you brew!
@pastel panther a gentle reminder there are kiddies here
(sorry)
part of the reason I do dev on ubuntu
Normally it automagically works. I wonder if I've hacked some config somewhere that I've since forgotten about
i am trying it on my test macbook
@pastel panther the gcc-arm-embedded cask was removed!! https://github.com/Homebrew/homebrew-cask/pull/56802
@slender iron @idle owl ^^also note
Updated Learn Guide with a warning for now: https://learn.adafruit.com/building-circuitpython/macos
Well, that answers that
That's unfortunate. Glad I was able to make use of it before it was gone.
Guess I'll just uninstall the cask and install the new version from source
https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads Download the 7-2018-q2 one. The 8-2018-q4 one has some minor issues with a few lines of code in tinyusb.
Hi folks - I'm messing around with an ESP8266 with a 2.4" TFT touchscreen featherwing; I'm reading lots of conflicting information about which library to use for high level graphics (especially text). GFX? BitmapFont? Framebuf? Where should I be looking for current best practice and examples?
@grim sparrow in CircuitPython?
@grim sparrow we're removing support for esp8266 with circuitpython 4.0 so you'll want to use framebuf in micropython
@slender iron Ok; so what about examples of use of Framebuf? The packaged example (or, at least, the ones I've seen) show how to create and draw on the buffer, but don't show how to hook the buffer up to the display.
I'm not aware of any
I presume it can be done? I mean, from looking at the code, it's not immediately obvious that it can be, other than by converting framebuf contents into individual pixel draw commands (which would be prohibitively slow)
Β―_(γ)_/Β―
@grim sparrow the 2.4" tft has too big resolution to really fit a framebuffer for it into the memory
of course you can send the contents of a framebuf to it, just send the underlying buffer, after setting the window with appropriate commands
this is how I do it in micropython: https://bitbucket.org/thesheep/micropython-rgb/src/2e459b88fe65ef944c73ef0170a2eb759146aa41/display.py#lines-41
@inner surge hello!
Hello guys, I bought the Blue&White LCD + Keypad kit for RPi
I am not able to set it up
Only this lights up
No text within the lcd
Here is my code which is the given example in the usage guide:
import time
import board
import busio
import adafruit_character_lcd.character_lcd_i2c as character_lcd
Modify this if you have a different sized Character LCD
lcd_columns = 16
lcd_rows = 2
Initialise I2C bus.
i2c = busio.I2C(board.SCL, board.SDA)
Initialise the lcd class
lcd = character_lcd.Character_LCD_I2C(i2c, lcd_columns, lcd_rows)
Turn backlight on
lcd.backlight = True
Print a two line message
lcd.message = "Hello\nCircuitPython"
Wait 5s
time.sleep(5)
lcd.clear()
adul, did you adjust the contrast knob?
No I didnt touch it, should I?
Oh
Yeah
I adjusted it
It displays
My bad lol
Thank you
Also, the recent keypad code addition is in the "character_lcd_rgb_i2c.py" and not in the "character_lcd_i2c.py" which I am using, should I just copy the code? @meager fog
Thank you once again
Any news on ST7789?
Why would such a great display not get circuitpython support?
zenith, not at this time - if you get it working you can submit a PR to https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display
looking at the datasheet, the commands seem to be the same as for the ili9341 display
the init sequence might need to be different
also, there is an issue open. you can voice your additional request for support there: https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display/issues/19
I saw the issue
Perhaps I will make an additional request
The pixel density is nice
and the square shape is awesome
@mossy needle i was about to reply to your question in #help-with-projects. re: adafruit_dotstar import failure on your Trinket. did you download and copy the adafruit_dotstar library onto the Trinket? it isn't included with the firmware...
https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries
@raven canopy Yes, I ultimately realized I had to download the library on the device, so it's working now. Thanks so much anyway!
sweet! just wanted to make sure you got an answer.
Hi all! I made a custom feather using a nrf52840 module, was able to program the bootloader.
What does a blue steady neopixel mean? I got the status light to blink and the neopixel is a solid blue and the USB drive doesnβt show up for me to upload circuitpython.
I have a reset button connected to the reset line (I think itβs p0.18 and on p1.06.
Any library available for creating Menus on LCD displays using Python?
i was thinking the same, but if its only the bootloader?
@tidal kiln heya im not sure wher eyou're seeing that the i2s pins on the feather m4 are wrong
yah. i could be chasing things down wrong. but looking here:
https://github.com/adafruit/ArduinoCore-samd/blob/master/variants/feather_m4/variant.h#L178
yeah its bootloader only, i hear the ubiquitous windows USB connect sound but don't see a BOOT drive π€ and the status light (LED_PRIMARY_PIN) slowly goes on/off
that becomes:
#define PIN_I2S_SDO (5u) = 5 = PA16
#define PIN_I2S_SDI PIN_SPI_MOSI = 24 = PB23
#define PIN_I2S_SCK PIN_A2 = 16 = PB8
#define PIN_I2S_FS PIN_SPI_MISO = 23 = PB22
and then checking datasheet, don't see i2s on those
assuming i have correct datasheet / table / column
huh
yeah what does the circuitpython i2s guide use?
https://learn.adafruit.com/adafruit-i2s-stereo-decoder-uda1334a/circuitpython-wiring-test#step-3
BCLK = TX
WSEL = D10
DIN = D11
kk ya must be mistake, tr y them n if they work yuo can pr! π
i did. but will do it again. since i thought m0 wasn't working also.
want to make double sure on all this
thanks for double checking
@tawny creek you can use the Microsoft Message Analyzer to get USB messages. not as easy as a USB debugger, but if you don't have one, it helps. https://blogs.msdn.microsoft.com/usbcoreblog/2013/11/08/capturing-usb-etw-traces-with-microsoft-message-analyzer-mma/
@raven canopy cool! i shall look into it
yep. if you need some help, let me know. been a while since i used it. from what i remember, filtering down to the usable messages takes some time. its tedious... π
Is it possible I am missing a step?
I created a board definition and modified boards.h to include that new board
i could only recommend to check that your descriptors are valid...
one thing im not sure is working is the reset button, its using the only reset capable pin -- but i dont see the status led or anything change
well, and that; make sure that the reset isn't blocking any startup.
#define RTS_PIN_NUMBER 5
#define HWFC false```
What is HWFC?
@solar basin @pastel panther I've learned that the serial monitor in VS Code is read-only, you can send characters to the serial port through a special menu command but have not found a way to send ctrl-d (char 4) to put the circuit playground in auto-reload mode/out of REPL. Given these limitations, putty will be my serial interface for now, it works fine.
not sure what CTS/RTS is either, I looked at the adafruit NRF52840 feather and couldnt see where those pins are
anyway shall check the USB stuff later, gotta do uni stuff.. thanks @raven canopy !
will followup latur
@tawny creek i assume HWFC == Hardware Flow Control, which utilizes CTS/RTS.
@tidal kiln back - on a train so not great wifi
but the i2s pins from circuitpython should be correct
pins verified
those should be right
ugh. my coffee must be broken. checking <= to an initial value of 0, with a descending range of 0-1000...is not a good idea. π€¦
@meager fog awesome. thanks again for checking. will PR. have a great train ride!
choo choo
@mild rain yeah, I played with a bit last night too. That's fine for my immediate needs but I can see where that'd be less than desirable for others lol
Do I remember a doc somewhere to set up a local build environment for Circuitpython? I can't remember where it was. I have a Windows 10 laptop and was wanting to setup to be able to build both mpy libraries and cp itself though I have no real plans other than to just be able to compile at this point.
I am having exact same issue but on Arduino Zero.
I flashed adafruit-circuitpython-arduino_zero-3.1.2.bin using BOSSA 1.9.1
command line Log is as follows:
C:\Program Files (x86)\BOSSA>bossac -e -w -v -R --offset=0x2000 adafruit-circuitpython-arduino_zero-3.1.2.bin
Erase flash
Done in 0.829 seconds
Write 188204 bytes to flash (2941 pages)
[==============================] 100% (2941/2941 pages)
Done in 2.302 seconds
Verify 188204 bytes of flash
[================...
Hi, I'm trying to add an esp8266 wifi coprocessor to my M4 express but am getting the following error when running the code on the learning system:
line 15 is:
uart = busio.UART(board.TX, board.RX, timeout=0.1)
Can anyone help?
thanks!
@terse kayak take a look at this https://learn.adafruit.com/building-circuitpython
@solar whale exactly what I was looking for. I knew I had see it somewhere. Thanks.
bleh make: *** No rule to make target lib/tinyusb/src/class/midi/midi_device.c', needed by build-circuitplayground_express_crickit/genhdr/qstr.i.last'. Stop.... time to rebuild my checkouts.
@jay6621 Better to ask this in https://forums.adafruit.com. Can you flash back to 2.3.1 using another computer? Try uninstalling ESET completely if you can, and check the list of installed programs for other suspicious stuff. Make sure there's no main.py or code.py, and do the erase_filesystem() stuff mentioned above. Also try on another computer.
@idle owl I added those missing files. Do I need to create a new PR?
Ok, I wasn't sure if you got the replies to github
Travis is now running on it, and has failed. (We all go through this!)
There's a couple of Pylint things it caught, and Sphinx isn't building. Have you dealt with Travis-CI output before?
No. I've only dealt with Jenkins on web development
Ok, here's a link to the output: https://travis-ci.com/adafruit/Adafruit_CircuitPython_RA8875
Take a look at it and if it would help, I can go through it with you.
Ok
I'm not sure what Jenkins looks like so I have no frame of reference to compare, but I know Travis can be confusing the first time through.
Ok, I can see a few things that are pretty obvious that I'll fix first.
Ok good!
FYI that is the most obvious Sphinx error you'll see, they get more obscure from there.
I should be around today so feel free to ping me as you run into things that don't make sense.
Ok, will do.
Huh, now I'm having the same issue building some targets that I saw someone else have last week.
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
QSTR updated
usage: mpy-tool.py [-h] [-d] [-f] [-q QSTR_HEADER]
[-mlongint-impl {none,longlong,mpz}] [-mmpz-dig-size N]
files [files ...]
mpy-tool.py: error: the following arguments are required: files
make: *** [build-circuitplayground_express/frozen_mpy.c] Error 2
make: *** Deleting file `build-circuitplayground_express/frozen_mpy.c'
Looks to me like it's attempting to run mpy-tool.py without any arguments
Seems to be 3760 bytes on metro_m4 after the changes (about to be pushed). I can't currently build circuitplayground_express and circuitplayground_express_crickit locally, so I'm going to see if Travis can without this disabled for circuitplayground_express_crickit.
@idle owl I went ahead and fixed a bunch of errors and pushed. Do you need to do anything now for it to try again?
Nope! It'll rerun each time on its own. And often provide you with a new set of errors π Sphinx likes to cascade fail.
Not provide you with everything at once, but one at a time, dole it out.
Yeah, I saw another potential failure and fixed it
Nice!
You got in behind a CircuitPython build, FYI, so it may be a bit before your run completes.
Ah, ok.
We've all also been through that. Repeatedly π
If you go to the build page on Travis CI, you can see the other builds running on the left side. If you see circuitpython, then sit back for a bit. π
I don't see a build page
Ok, so if you go to the bottom of your PR, there is a "Some checks haven't completed yet" with a "Travis CI - Pull Request" bit under it with a "Details" link. Click that link. Then you'll get to the Details page, On that page, you'll see "The build" followed by "created" at the moment, but may be "running", or "failed" or whatever the status is. "The build" link will take you to the build page.
That's what I linked you to earlier.
Ok, I got to the page, but I don't see that it says that it's working on circuitpython.
Maybe I don't have access to see that.
Hmm. Ok maybe not. Well it's safe to assume if it's taking forever, CircuitPython is building.
Yeah
or, Travis just woke up from a nap. π
@idle owl I have a couple questions about the generated output. First, I'm not sure why it's generating "Instance of 'SPIDevice' has no 'write' member (no-member)". Could you shed some light on that?Second, do you have any idea what the Sphinx error is wanting me to do?
@gilded cradle Ok the SPIdevice thing is an issue. You can disable pylint for those errors. I'll tell you how to do that in a moment. Yes, I do know the problem with the sphinx thing, there's an issue with something in a different file, let me look at the rest of your files and find it. It's attempting to build the API docs page, and it can't because there's a title line in one of your .py files that isn't exactly right.
Ok, that kind of makes sense...
