Release: Android TotalControl App

Dear users,

I’m proud to announce that I’ve develloped a new App for Android. This one just needs your particle cloud credentials and automaticly creates buttons for all your published functions of all your registered devices. If you publish “int” variables with the same name as your function and give them the value of 1 or 2, it will create a green or red text on the button accordingly. I’m also releasing one of my photons code for an example.

int buttonPin = A0;
int button2Pin = A1;
int ledPin = D0;
int lichtPin = D2;
int relay1 = D1;
int lichtaan = 1;
bool laststate = false;
int poortopen = 1;
void setup() {

  pinMode( buttonPin , INPUT_PULLUP);
  pinMode( button2Pin , INPUT_PULLUP);
  pinMode( ledPin , OUTPUT );
  pinMode( lichtPin , OUTPUT );
  pinMode( relay1 , OUTPUT );
  RGB.control(true);
  RGB.color(0, 0, 0);
  Particle.function("LichtGarage", switchLicht);
  Particle.function("PoortGarage", switchrelay1);
  Particle.variable("LichtGarage", lichtaan);
  Particle.variable("PoortGarage", poortopen);
}

void loop()
{
  int buttonState = digitalRead( buttonPin );
  int buttonState2 = digitalRead( button2Pin );
  if ( buttonState == LOW )
  {
    poortopen = 2;
    digitalWrite( ledPin, HIGH);
  } else {
    poortopen = 1;
    digitalWrite( ledPin, LOW);
  }
  if ( buttonState2 == LOW )
  {
    if (laststate) {
      switchLicht("");
    }
    laststate = false;
  } else {
    if (laststate == false) {

      switchLicht("");
    }
    laststate = true;
  }
  if ( lichtaan == 2 )
  {
    digitalWrite( lichtPin, HIGH);
  } else {
    digitalWrite( lichtPin, LOW);
  }
}
int switchLicht(String dada) {
  if (lichtaan == 2) {
    lichtaan = 1;
  } else {
    lichtaan = 2;
  }
}
int switchrelay1(String dada) {
  digitalWrite(relay1, HIGH);
  delay(500);
  digitalWrite(relay1, LOW);
  return 1;
}

My Garage has 2 normal switches for the light wich I reconnected to the photon and then seperatly connect the lights to a relay connected to the photon. My garagedoor has a normal mechanical “push” sensor which activates as soon the door opens. When the door is open a flash light connected to another relay starts blimping…

The app itself can be found on the playstore, hope it can be of help to some of you…

Photon Particle TotalControl

Greetings,
Vibrocil

3 Likes

Insists that my credentials are wrong, even though they are correct

Just on the top of my head. Can you logout the IDE and login using those credentials? No autofill… Does you password contain ‘special characters’?

So I’ve already ruled out the use of ‘!’ ‘/’ and ‘*’ in the password… These just work.
Any other ‘special characters’ you might use in your password?
I really suggest logging out of the cloud on your computer and relogin using same credentials you’re using (without the autofill ofcourse)

Would it be possible to see the Code from your App? I try to develope a same little App, but I have huge Problems to connect the App with the Cloud. :fearful:

Sorry, as I’m developing a paying pro version(€1) I cannot do this :slight_smile: It’s build from scratch using the documentation of the SDK and some experience.

Ahh yes I understand :grinning: :wink: