Skip to content

bluetooth serial port access on raspberry pi 3b #9

@ghost

Description

Hi, I created a sample bluetooth controlled led using piduino library. Below is the code is executed. How can I include rfcomm in the below code ? I am able to run the code, but not able to control the LED using android via bluetooth.

#include <Piduino.h>

int led = 21;
int data = 0;

void setup()

{

pinMode(led, OUTPUT);
Serial.begin(9600);

}

void loop()
{

data = Serial.read();
if(data == '1')
{
digitalWrite(led, HIGH);
}

if(data == '0')
{
digitalWrite(led, LOW);
}

}

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions