‘아빠 어디야’ 앱 아두이노 소스

#include <SoftwareSerial.h>
#define SHOCK_A_IN_PIN 0

SoftwareSerial BTSerial(0,1);
byte buffer[1024];
int bufferPosition;

int iShockValue = 0;

void setup() {
BTSerial.begin(9600);
Serial.begin(9600);
bufferPosition=0;
}

void loop() {
iShockValue = 1024- analogRead(SHOCK_A_IN_PIN);
if (iShockValue >= 500){
Serial.println(iShockValue);
BTSerial.println(iShockValue);
}
delay(100);
}

Leave a Reply

Your email address will not be published. Required fields are marked *