// This #include statement was automatically added by the Particle IDE.
#include "lib1.h"
// This #include statement was automatically added by the Particle IDE.
#include <DataPacket.h>
// This #include statement was automatically added by the Particle IDE.
#include <neopixel.h>
#define PIXEL_COUNT 1
#define PIXEL_PIN D7
#define PIXEL_TYPE WS2812B
int buttonPin1=D8;
int buttonPin2=D7;
int buttonPin3=D6;
int buttonPin4=D5;
int buttonPin5=D4;
int buttonPin6=D1;
int fsrPin = A0;
int fsrReading = 0;
String ans;
void setup()
{
pinMode (buttonPin1, INPUT);//_PULLUP);
pinMode (buttonPin2, INPUT);//_PULLUP);
pinMode (buttonPin3, INPUT);//_PULLUP);
pinMode (buttonPin4, INPUT);//_PULLUP);
pinMode (buttonPin5, INPUT);//_PULLUP);
pinMode (buttonPin6, INPUT);//_PULLUP);
Serial.begin(9600);
//Serial.println('beginning CSV-serial');
}
void loop()
{
int button1 = digitalRead(buttonPin1);
int button2 = digitalRead(buttonPin2);
int button3 = digitalRead(buttonPin3);
int button4 = digitalRead(buttonPin4);
int button5 = digitalRead(buttonPin5);
int button6 = digitalRead(buttonPin6);
int output[]={button1,button2,button3,button4,button5,button6};
String outprint="";
int sum = button1+button2+button3+button4+button5+button6;
for (int i=0;i<6;i++)
{
outprint= outprint+String(output[i]);
}
if (sum!=0) {
ans.concat(","+outprint);
Particle.publish ("sensor-reading", outprint);
fsrReading = analogRead(fsrPin);
Particle.variable("force", &fsrReading, INT);
Particle.publish("Finger scan pressure", String (fsrReading));
delay(1000);
}
}
Click to Expand
Content Rating
Is this a good/useful/informative piece of content to include in the project? Have your say!
You must login before you can post a comment. .