Skip to content

using sprint #21

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

Open
markbiasotti opened this issue Sep 29, 2024 · 1 comment
Open

using sprint #21

markbiasotti opened this issue Sep 29, 2024 · 1 comment

Comments

@markbiasotti
Copy link

I would like to use the Record text message to include variables using sprintf as shown below, but even thou it compiles and uploads, fails to write record. Is this not possible or a bug?

To see full issue are arduino forum go here

char buffer[40]; int days = 3; sprintf(buffer,"Days user has taken their medication = %d", days); tag.writeNDEFText(buffer, &memLoc, false, true); // MB=0, ME=1

@IoTopenTech
Copy link

IoTopenTech commented Nov 21, 2024

The following code works for me:

int parte_entera = (int) temperatura_celsius;

int parte_decimal = (int) ((temperatura_celsius - parte_entera) * 100);

sprintf(mensaje,"Temperatura = %d.%d", parte_entera,parte_decimal);

uint16_t memLoc = tag.getCCFileLen();

tag.writeNDEFText(mensaje, &memLoc, true, true); // MB=1, ME=1

Serial.println("Temperatura actualizada correctamente");

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

No branches or pull requests

2 participants