Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added INPUT_PULLUP support and let analog write use full PWM range #33

Merged
merged 3 commits into from
Mar 31, 2021

Conversation

ZodiusInfuser
Copy link

Made two tweaks to the firmware to support an upcoming Pimoroni product. Specifically:

  • Added support to pinMode for INPUT_PULLUP, so digitalRead is easier to use with buttons
  • Updated analogWrite to use the full PWM range, so that common anode LEDs can be turned off

Have built the firmware locally under Ubuntu 18.04 LTS and tested these two changes work.

@brentru
Copy link
Member

brentru commented Mar 26, 2021

@ZodiusInfuser Could you change the version by one patch version, #31 is 1.7.2 and I want to pull that in first.

@ZodiusInfuser
Copy link
Author

Version updated in the four needed places. Just waiting on checks to pass.

@brentru
Copy link
Member

brentru commented Mar 26, 2021

@ZodiusInfuser I just merged in #31, could you resolve the conflicts and @ me when ready?

@ZodiusInfuser
Copy link
Author

@brentru Conflicts resolved. I noticed though that the merge of #31 did not include an update to the changelog for 1.7.2, so you may wish to add something before merging in my change.

@ZodiusInfuser
Copy link
Author

@brentru Does this all look okay? Although not essential (can still use 1.7.1), we could do with this being in a new release by the middle of the week so we can flash production hardware with it.

@brentru
Copy link
Member

brentru commented Mar 29, 2021

@ZodiusInfuser I can test on hardware Wednesday morning (EST) if that works for you? Changelog can be left as-is. We use release notes instead.

@brentru
Copy link
Member

brentru commented Mar 29, 2021

@ZodiusInfuser I've also updated our guide to include information about how to flash nina-fw to an airlift using the RP2040 as a serial-usb-passthru: https://learn.adafruit.com/quickstart-raspberry-pi-rp2040-with-ble-and-circuitpython/upgrade-rp2040-airlift-firmware

The source code is written with the pico-sdk, you may want to modify it to target your hardware (we distribute as UF2s). (https://github.com/adafruit/Adafruit_Learning_System_Guides/tree/master/Adafruit_ESP32_Arduino_Demos/SerialESPPassthrough/serial_passthru_rp2040)

@ZodiusInfuser
Copy link
Author

Wednesday morning (EST) is good.

Thanks for those links. They would have been really handy a few weeks ago when I was tasked with doing this. Particularly took me a long while to realise stdio_set_translate_crlf needed to be called during setup 😄

@brentru
Copy link
Member

brentru commented Mar 29, 2021

Wednesday morning (EST) is good.

Perfect.

Particularly took me a long while to realise stdio_set_translate_crlf needed to be called during setup 😄

YES!

@brentru
Copy link
Member

brentru commented Mar 31, 2021

Tested on hardware, LGTM

ESP32 SPI webclient test
ESP32 found and in idle mode
Firmware vers. bytearray(b'1.7.3\x00')
MAC addr: ['0x28', '0x7f', '0x11', '0x12', '0xcf', '0xa4']
...
Connecting to AP...
Connected to Transit    RSSI: -77
My IP address is ...
IP lookup adafruit.com: 104.20.39.240
Ping google.com: 20 ms
Fetching text from http://wifitest.adafruit.com/testwifi/index.html
----------------------------------------
This is a test of Adafruit WiFi!
If you can read this, its working :)

----------------------------------------

Fetching json from http://api.coindesk.com/v1/bpi/currentprice/USD.json
----------------------------------------
{'time': {'updated': 'Mar 31, 2021 15:12:00 UTC', 'updatedISO': '2021-03-31T15:12:00+00:00', 'updateduk': 'Mar 31, 2021 at 16:12 BST'}, 'disclaimer': 'This data was produced from the CoinDesk Bitcoin Price Index (USD). Non-USD currency data converted using hourly conversion rate from openexchangerates.org', 'bpi': {'USD': {'code': 'USD', 'description': 'United States Dollar', 'rate_float': 59243.7, 'rate': '59,243.7067'}}}
----------------------------------------
Done!

Code done running.

Press any key to enter the REPL. Use CTRL-D to reload.

Adafruit CircuitPython 6.2.0-beta.4 on 2021-03-18; Adafruit Feather M4 Express with samd51j19```

@brentru brentru merged commit ec9e20f into adafruit:master Mar 31, 2021
@brentru
Copy link
Member

brentru commented Mar 31, 2021

@ZodiusInfuser
Copy link
Author

Thank you very much @brentru!

@dhalbert
Copy link

dhalbert commented Nov 3, 2023

@ZodiusInfuser what is the product that you are supporting here? I am trying to track down all the places where NINA-FW is used. Thanks.

@ZodiusInfuser
Copy link
Author

Hi @dhalbert. The product was the Pimoroni Pico Wireless pack: https://shop.pimoroni.com/products/pico-wireless-pack
I say 'was' because we discontinued it not long after the Pico W launched since that made it redundant. It seems a few resellers still stock it though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants