Skip to content

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.

1 participant