You are on page 1of 1

SEGUIDO0R DE LINEAS CON PARADEROS

#include <SoftwareSerial.h>

SoftwareSerial mySerial(10, 11); // RX, TX

String senal;

int dato=3;

void setup() {

// put your setup code here, to run once:

pinMode(dato,OUTPUT);

Serial.begin(9600);

mySerial.begin(9600);

void loop() {

// put your main code here, to run repeatedly:

if(mySerial.available()>0){

senal=mySerial.readString();

if(senal.startsWith("motor")){

senal.replace("motor","");

analogWrite(dato,senal.toInt());

Serial.println(senal.toInt());

You might also like