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

Analog read #46

Closed
nezra opened this issue May 23, 2019 · 4 comments
Closed

Analog read #46

nezra opened this issue May 23, 2019 · 4 comments
Labels
enhancement New feature or request

Comments

@nezra
Copy link

nezra commented May 23, 2019

given the huzzah32 with it's battery & voltage divider attached directly to one of the analog pins; and the release the kraken patch, #34?, would it be possible to add an analog read function? and maybe a digital read?

I'd like to use the built in battery functionality of the huzzah32 to power a portion of a project; and possibly use it for supplementary IO; but i'd want to monitor the voltage. the added voltage regulator & power storage would be able to provide an easier way than making a voltage regulator tacked a feather & it's battery pin.

I don't pretend to understand the nina-fw and the command handler language; but it reminds me alot of arduino. after reading through it, would something like:

int setAnalogRead(const uint8_t command[], uint8_t response[])
{
uint8_t pin = command[4];
unit8_result = 255

result=analogRead(pin);

response[2] = 1; // number of parameters
response[3] = sizeof(result); // parameter 1 length
memcpy(&response[4], result, sizeof(result));

return 9;
}

be sufficient?

@ladyada
Copy link
Member

ladyada commented May 23, 2019

you could but yeah you'd have to add the matching capability to nina-fw as well - we don't have plans to add it but feel free to!

@ladyada ladyada added the enhancement New feature or request label May 23, 2019
@anecdata
Copy link
Member

anecdata commented May 23, 2019

Your issue on NINA could be combined with arduino/nina-fw#19
That's the place to start. Once (if) it's implemented in the NINA firmware, it's straightforward to expose it from the ESP32SPI library.

@anecdata
Copy link
Member

anecdata commented Oct 17, 2019

PRs for #76 submitted (ESP32SPI library and NINA firmware), to provide digital and analog reads.

@brentru
Copy link
Member

brentru commented Oct 23, 2019

Close via #80

@brentru brentru closed this as completed Oct 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants