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

Template for the String datatype for Particle Variable was not being used #78

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pfeerick
Copy link
Contributor

@pfeerick pfeerick commented Jan 16, 2017

Moved and 'fixed up' the template for the String Partice Variable to OakParticle.h. It looks like it was missed when DarkLotus did his changes in #37. Test code will be added as a second comment. Please stress test and review the code, as it worked for me, but my knowledge of (variadic) templates goes as far as copy, paste and mimic... I've managed to avoid them completely till now ;-O

…used. Moved and 'fixed up' the template for the String Partice Variable to OakParticle.h. It looks like it was missed when DarkLotus did his changes in digistump#37
@pfeerick
Copy link
Contributor Author

SYSTEM_MODE(SEMI_AUTOMATIC)

int analogvalue = 0;
double tempC = 0;
const char *message = "my name is particle";
String aString = "this is a String!";

void setup()
{
  // variable name max length is 12 characters long
  Particle.variable("analogvalue", analogvalue);
  Particle.variable("temp", tempC);
  Particle.variable("mess", message);
  Particle.variable("mess2", aString);

  // connect to particle now that the variables have been defined
  if (Particle.connected() == false) 
  {
    Particle.connect();
  }

  pinMode(A0, INPUT);
}

void loop()
{
  // Read the analog value of the sensor (TMP36)
  analogvalue = analogRead(A0);
  //Convert the reading into degree celcius
  tempC = (((analogvalue * 3.3)/4095) - 0.5) * 100;
  delay(200);
}

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.

None yet

1 participant