Skip to content

Analog read #46

Closed
Closed
@nezra

Description

@nezra

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions