I wanna turn on led by bluetooth, but turn off by piezoelectric effect element

I already have .apk by app inventor2. So I think I have problem with code. but I don't know arduino well. That's why I need your help Here is my code

define ON 1

define OFF 0

define LED_PIN 13

define Pie 8

void setup() { // put your setup code here, to run once: pinMode(LED_PIN,OUTPUT); pinMode(Pie, INPUT); Serial.begin(57600);

}

do {

unsigned char rxBuf =0;

if (Serial.available()) { rxBuf = Serial.read();

}

switch(rxBuf) { case '0': digitalWrite(LED_PIN, ON); delay(500); digitalWrite(LED_PIN,OFF); delay(500); Serial.println("LED On"); break; case '1':digitalWrite(LED_PIN, OFF); Serial.println("LED Off"); break; } } while(digitalRead(Pie,On))

I need led blinking before Pie have digital signal

When I compile the code, problem is came at " do { ". Plz help me

What do you think this does

while(digitalRead(Pie,On))

if Pie On, stop blink led. Am I right?

What makes pin 8 go high? What makes it low? How do you know what state it's in?

korLIM: When I compile the code, problem is came at " do { ".

See https://www.arduino.cc/en/Reference/DoWhile

if external simulate is represent, Pie can make eletricity. So i want to use this eletricity to On

Pie can make eletricity.

What?

void setup() {
// put your setup code here, to run once:
pinMode(LED_PIN,OUTPUT);
pinMode(Pie, INPUT);
Serial.begin(57600);

}

do {

You're missing something between the end of setup() and the "do {".