Thanks Travis,
I appreciate all your help on this. It seems like I am missing something super simple.
btw, I took KeyFob.cpp, and I add a bunch of logging, so I could see what is going on. ALL of the digitalRead calls return 0, no matter what button I push.
void KeyFob::evalFob()
{
recentFobID = Serial1.read();
char buffer[33];
int newStatus = 0;
int k1=digitalRead(kfb1);
int k2=digitalRead(kfb2);
int k3=digitalRead(kfb3);
int k4=digitalRead(kfb4);
int k5=digitalRead(kfb5);
int k6=digitalRead(kfb6);
int k7=digitalRead(kfb7);
int k8=digitalRead(kfb8);
char buttons[40];
itoa(k1, buffer, 10);
strcpy(buttons, "b1=");
strcat(buttons, buffer);
itoa(k2, buffer, 10);
strcat(buttons, ",b2=");
strcat(buttons, buffer);
itoa(k3, buffer, 10);
strcat(buttons, ",b3=");
strcat(buttons, buffer);
itoa(k4, buffer, 10);
strcat(buttons, ",b4=");
strcat(buttons, buffer);
itoa(k5, buffer, 10);
strcat(buttons, ",b5=");
strcat(buttons, buffer);
itoa(k6, buffer, 10);
strcat(buttons, ",b6=");
strcat(buttons, buffer);
itoa(k7, buffer, 10);
strcat(buttons, ",b7=");
strcat(buttons, buffer);
itoa(k8, buffer, 10);
strcat(buttons, ",b8=");
strcat(buttons, buffer);
Particle.publish("Buttons", buttons, 60, PUBLIC);
(I know it is ugly, but I’m not a C++ programmer, and this was the way I found to do it). BUT I see this in the events:
event: Buttons
data: {“data”:“b1=0,b2=0,b3=0,b4=0,b5=0,b6=0,b7=0,b8=0”,“ttl”:60,“published_at”:“2018-08-15T16:08:15.436Z”,“coreid”:“2e0028000447363333343435”}
event: Buttons
data: {“data”:“b1=0,b2=0,b3=0,b4=0,b5=0,b6=0,b7=0,b8=0”,“ttl”:60,“published_at”:“2018-08-15T16:08:18.997Z”,“coreid”:“2e0028000447363333343435”}
event: Buttons
data: {“data”:“b1=0,b2=0,b3=0,b4=0,b5=0,b6=0,b7=0,b8=0”,“ttl”:60,“published_at”:“2018-08-15T16:08:19.232Z”,“coreid”:“2e0028000447363333343435”}
Thanks,
Mark