Hi, I'm on a school project and my task is to create an app on appinventor to see when a cat entered or left the house, I did the code to see if the cat is in or out of the house but now i have to show the time when he entered/left the house but i don't know how to do it, can you help me please ?
On arduino i did this code to see if the cat is in/out :
#include <SoftwareSerial.h>
const int BPRiri = 8;
const int BPFifi = 9;
int dataFromBt;
SoftwareSerial bluetooth(3, 2);
void setup()
{
Serial.begin(9600); // Begin the serial monitor at 9600bps
bluetooth.begin(9600); // Start bluetooth serial at 9600
bluetooth.print("Bluetooth connecte !");
}
void loop()
{
int CRiri = digitalRead(BPRiri);
int CFifi = digitalRead(BPFifi);
if (CRiri == HIGH && CFifi == HIGH){
bluetooth.print("1");
Serial.println("Riri, Fifi"); }
if (CRiri == LOW && CFifi == LOW) {
bluetooth.print("0");
Serial.println("Personne"); }
if (CRiri == HIGH && CFifi == LOW){
bluetooth.print("2");
Serial.println("Riri"); }
if (CRiri == LOW && CFifi == HIGH){
bluetooth.print("3");
Serial.println("Fifi"); }
}
"Riri" and "Fifi" are the cats