Three Xbee synchronization blinking - arduino

I'm doing synchronization blinking with three XBee module and Arduino Uno,
the first is master, second is slave/master and the other one is a slave.
The master is going to give the command for both slave/master and slave to blinking, and when the master is switch off, the slave/master will taking over his job giving the command to blinking.
But the slave/master didn't go so well because of the coding didn't right.
Can anyone take a look at my coding and show me what is wrong with my coding.
Master Coding =
#include <SoftwareSerial.h>
#define Dout 2
#define Din 3
//#define LED 9
SoftwareSerial XBee(Dout, Din);
//char XBee_message;
int MasterSignalSent = 0;
const long interval = 2500;
unsigned long previousMillis = 0;
void setup() {
Serial.begin(9600);
XBee.begin(9600);
pinMode(13, OUTPUT);
}
void loop(){
unsigned long currentMillis = millis();
if (currentMillis - previousMillis >= interval) {
Serial.println(currentMillis);
previousMillis = currentMillis;
{
delay(1500);
SendMasterSignal();//+
MasterSignalSent = 1;
delay(1000);
SendSyncSignal();//-
BlinkLed();
MasterSignalSent = 0;
}
}
}
void SendMasterSignal()
{
Serial.println("SendingMasterSignal. . .");
XBee.write('+');
}
void SendSyncSignal()
{
Serial.println("SendingSyncSignal. . .");
XBee.write('-');
}
void BlinkLed()
{
digitalWrite(13, HIGH);
delay(250);
digitalWrite(13, LOW);
//delay(2200);
}
Slave/Master Coding =
#include <SoftwareSerial.h>
#define Dout 2
#define Din 3
SoftwareSerial XBee (Dout, Din);
const long interval = 2500;
unsigned long previousMillis = 0;
int MasterSignalReceived = 0;
int ReceiveSyncSignal = 0;
int MasterSignalSent = 0;
char XBee_signal;
void setup() {
Serial.begin(9600);
XBee.begin(9600);
pinMode(13, OUTPUT);
}
void loop() {
unsigned long currentMillis = millis();
if (currentMillis - previousMillis >= interval) {
previousMillis = currentMillis;
while(XBee.available()){
XBee_signal = XBee.read();
Serial.println(XBee_signal);
delay(1500);
if (MasterSignalReceived == 0)
{
BecomeMaster();
}
else if (MasterSignalReceived == 1)
{
if (XBee_signal = '-'){
BlinkLed();
(MasterSignalReceived = 0);
}
else{
digitalWrite(13, LOW);
}
}
}
}
}
void BecomeMaster()
{
unsigned long currentMillis = millis();
if (currentMillis - previousMillis >= interval) {
Serial.println(currentMillis);
previousMillis = currentMillis;
{
delay(1500);
SendMasterSignal();
MasterSignalSent = 1;
delay(2500);
SendSyncSignal();
BlinkLed();
MasterSignalSent = 0;
}
}
}
void SendMasterSignal()
{
XBee.write('+');
Serial.println("SendMasterSignalDone");
}
void SendSyncSignal()
{
XBee.write('-');
Serial.println("SendSyncSignalDone");
}
void BlinkLed()
{
digitalWrite(13, HIGH);
delay(1000);
digitalWrite(13, LOW);
}
The slave is waiting for the command to blinking but the slave/master didn't send any command as the coding write when the master switches off.

Related

AttachIntrerrupt stops NRF24L01+ from working - ARDUINO

If I remove attachInterrupt(digitalPinToInterrupt(encoder1),readEncoder,RISING); The code works. But once its added, the radio.available doesnt let anything under it run.
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(7, 8); // CE, CSN
const byte address[6] = "00001";
struct InputData // define stuct
{
int x;
int y;
};
InputData data;
// Motor A connections
int motor_enA = 9;
int motor_in1 = 10;
int motor_in2 = 6;
int encoder1 = 2;
int encoder2 = 3;
int counter = 0;
int angle = 0;
void setup() {
Serial.begin(9600);
radio.begin();
radio.openReadingPipe(1, address);
radio.setPALevel(RF24_PA_MIN);
radio.startListening();
// Set all the motor control pins to outputs
pinMode(motor_enA, OUTPUT);
pinMode(motor_in1, OUTPUT);
pinMode(motor_in2, OUTPUT);
// Turn off motors - Initial state
digitalWrite(motor_in1, LOW);
digitalWrite(motor_in2, LOW);
analogWrite(motor_enA, 255);
pinMode (encoder1, INPUT);
pinMode (encoder2, INPUT);
attachInterrupt(digitalPinToInterrupt(encoder1),readEncoder,RISING);
}
void loop() {
readEncoder();
if (radio.available()) {
radio.read(&data, sizeof(data));
// Serial.println(data.y);
if (data.y > 5) {
digitalWrite(motor_in1, HIGH);
digitalWrite(motor_in2, LOW);
}
else if (data.y < -5) {
digitalWrite(motor_in1, LOW);
digitalWrite(motor_in2, HIGH);
}
else {
digitalWrite(motor_in1, LOW);
digitalWrite(motor_in2, LOW);
}
}
if(counter>1){
counter=0;
angle+=2;
}else if(counter<-1){
counter=0;
angle-=2;
}
Serial.print("Position: ");
Serial.println(angle);
}
void readEncoder()
{
if(digitalRead(encoder1)==HIGH){
int b = digitalRead(encoder2);
if(b>0){
counter++;
}
else{
counter--;
}
}
}
I have tried removing and adding the line, as described above^^
as mentioned by Hcheung, make counter volatile and remove readEncoder(); from loop.
I simplify a bit ISR readEncoder();
volatile int counter = 0;
[....]
void readEncoder() {
//if(digitalRead(encoder1)==HIGH){ //we are precisely here because digitalRead(encoder1) = HIGH !
if(digitalRead(encoder2)) counter++;
else counter--;
}

blinking WS2812 fastLED with milis arduino

I'm trying to get my led to blink every 2 seconds using millis.
Delay is not a possibility as I have other sensors running.
So far I got this, but it does not seem to work
#include "FastLED.h"
#define NUM_LEDS 12 // number of LEDS in neopixel ring
#define DATA_PIN 10 // for neopixel ring
CRGB leds[NUM_LEDS];
long period = 2000;
long currentMillis = 0;
long startMillis = 0;
void setup() {
FastLED.addLeds<WS2812, DATA_PIN, RGB>(leds, NUM_LEDS);
}
void loop() {
currentMillis = millis();
if (currentMillis - startMillis >= period) {
startMillis = currentMillis;
leds[7]=CRGB(255,0,0);
FastLED.show();
}
}
Does this get you a little closer?
#include "FastLED.h"
#define NUM_LEDS 12 // number of LEDS in neopixel ring
#define DATA_PIN 10 // for neopixel ring
CRGB leds[NUM_LEDS];
unsigned long period = 2000;
unsigned long currentMillis = 0;
unsigned long startMillis = 0;
boolean ledOn = false;
void setup() {
FastLED.addLeds<WS2812, DATA_PIN, RGB>(leds, NUM_LEDS);
}
void loop() {
currentMillis = millis();
if (currentMillis - startMillis >= period) {
startMillis = currentMillis;
ledOn = !ledOn;
if(ledOn){
leds[7]=CRGB(255,0,0);
}
else {
leds[7]=CRGB(0,0,0);
}
FastLED.show();
}
}

Arduino street light with button attachInterrupt

I am trying to run a program in Arduino Uno where the street light that has 3 colors, red, yellow and green, and when I press a button, the street light goes from green to yellow to red and then the pedestrian street light goes from red to green, just like a normal street light. Problem is my program does not read my button when it's pressed for some reason, I thought it was maybe the protoboard or the Arduino but when I try to run it on circuits.io the result is the same, leading me to the conclusion that my code is what is wrong. So here it is:
//libreria
#define EVENT_NONE 0
#define EVENT_EVERY 1
#define EVENT_OSCILLATE 2
#define MAX_NUMBER_OF_EVENTS (10)
#define TIMER_NOT_AN_EVENT (-2)
#define NO_TIMER_AVAILABLE (-1)
class Event {
public:
Event(void);
void update(void);
void update(unsigned long now);
int8_t eventType;
unsigned long period;
int repeatCount;
uint8_t pin;
uint8_t pinState;
void (*callback)(void);
unsigned long lastEventTime;
int count;
};
Event::Event(void)
{
eventType = EVENT_NONE;
}
void Event::update(void)
{
unsigned long now = millis();
update(now);
}
void Event::update(unsigned long now)
{
if (now - lastEventTime >= period) {
switch (eventType) {
case EVENT_EVERY:
(*callback)();
break;
case EVENT_OSCILLATE:
pinState = !pinState;
digitalWrite(pin, pinState);
break;
}
lastEventTime = now;
count++;
}
if (repeatCount > -1 && count >= repeatCount) {
eventType = EVENT_NONE;
}
}
//libreria timer
class Timer {
public:
Timer(void);
int8_t every(unsigned long period, void (*callback)(void));
int8_t every(unsigned long period, void (*callback)(void), int repeatCount);
int8_t after(unsigned long duration, void (*callback)(void));
int8_t oscillate(uint8_t pin, unsigned long period, uint8_t startingValue);
int8_t oscillate(uint8_t pin, unsigned long period, uint8_t startingValue, int repeatCount);
/**
* This method will generate a pulse of !startingValue, occuring period after the
* call of this method and lasting for period. The Pin will be left in !startingValue.
*/
int8_t pulse(uint8_t pin, unsigned long period, uint8_t startingValue);
/**
* This method will generate a pulse of pulseValue, starting immediately and of
* length period. The pin will be left in the !pulseValue state
*/
int8_t pulseImmediate(uint8_t pin, unsigned long period, uint8_t pulseValue);
void stop(int8_t id);
void update(void);
void update(unsigned long now);
protected:
Event _events[MAX_NUMBER_OF_EVENTS];
int8_t findFreeEventIndex(void);
};
Timer::Timer(void)
{
}
int8_t Timer::every(unsigned long period, void (*callback)(), int repeatCount)
{
int8_t i = findFreeEventIndex();
if (i == -1)
return -1;
_events[i].eventType = EVENT_EVERY;
_events[i].period = period;
_events[i].repeatCount = repeatCount;
_events[i].callback = callback;
_events[i].lastEventTime = millis();
_events[i].count = 0;
return i;
}
int8_t Timer::every(unsigned long period, void (*callback)())
{
return every(period, callback, -1); // - means forever
}
int8_t Timer::after(unsigned long period, void (*callback)())
{
return every(period, callback, 1);
}
int8_t Timer::oscillate(uint8_t pin, unsigned long period, uint8_t startingValue, int repeatCount)
{
int8_t i = findFreeEventIndex();
if (i == NO_TIMER_AVAILABLE)
return NO_TIMER_AVAILABLE;
_events[i].eventType = EVENT_OSCILLATE;
_events[i].pin = pin;
_events[i].period = period;
_events[i].pinState = startingValue;
digitalWrite(pin, startingValue);
_events[i].repeatCount = repeatCount * 2; // full cycles not transitions
_events[i].lastEventTime = millis();
_events[i].count = 0;
return i;
}
int8_t Timer::oscillate(uint8_t pin, unsigned long period, uint8_t startingValue)
{
return oscillate(pin, period, startingValue, -1); // forever
}
/**
* This method will generate a pulse of !startingValue, occuring period after the
* call of this method and lasting for period. The Pin will be left in !startingValue.
*/
int8_t Timer::pulse(uint8_t pin, unsigned long period, uint8_t startingValue)
{
return oscillate(pin, period, startingValue, 1); // once
}
/**
* This method will generate a pulse of startingValue, starting immediately and of
* length period. The pin will be left in the !startingValue state
*/
int8_t Timer::pulseImmediate(uint8_t pin, unsigned long period, uint8_t pulseValue)
{
int8_t id(oscillate(pin, period, pulseValue, 1));
// now fix the repeat count
if (id >= 0 && id < MAX_NUMBER_OF_EVENTS) {
_events[id].repeatCount = 1;
}
return id;
}
void Timer::stop(int8_t id)
{
if (id >= 0 && id < MAX_NUMBER_OF_EVENTS) {
_events[id].eventType = EVENT_NONE;
}
}
void Timer::update(void)
{
unsigned long now = millis();
update(now);
}
void Timer::update(unsigned long now)
{
for (int8_t i = 0; i < MAX_NUMBER_OF_EVENTS; i++) {
if (_events[i].eventType != EVENT_NONE) {
_events[i].update(now);
}
}
}
int8_t Timer::findFreeEventIndex(void)
{
for (int8_t i = 0; i < MAX_NUMBER_OF_EVENTS; i++) {
if (_events[i].eventType == EVENT_NONE) {
return i;
}
}
return NO_TIMER_AVAILABLE;
}
This code was just a way to import the libraries since the circuits.io cannot use the #include Timer library
And this is the actual code:
// Street Light Code
int redCar = 12;
int yellowCar = 11;
int greenCar = 10;
int redWalk = 9;
int greenWalk = 8;
const int button = 2;
unsigned long lightChange = 1000;
volatile int buttonState = 0;
Timer t;
void setup() {
pinMode(redCar, OUTPUT);
pinMode(yellowCar, OUTPUT);
pinMode(greenCar, OUTPUT);
pinMode(redWalk, OUTPUT);
pinMode(greenWalk, OUTPUT);
pinMode(button, INPUT);
attachInterrupt(0, interrupcion, RISING);
digitalWrite(greenCar, HIGH);
digitalWrite(redWalk, HIGH);
}
void loop() {
t.update();
}
void interrupcion() {
buttonState = digitalRead(button);
start();
}
void start() {
digitalWrite(greenCar, HIGH);
digitalWrite(yellowCar, LOW);
digitalWrite(redCar, LOW);
digitalWrite(greenWalk, LOW);
digitalWrite(redWalk, HIGH);
t.after(lightChange, green_light_car);
}
void green_light_car() {
t.oscillate(greenCar, 50, LOW, 10);
digitalWrite(yellowCar, LOW);
digitalWrite(redCar, LOW);
digitalWrite(greenWalk, LOW);
digitalWrite(redWalk, HIGH);
t.after(lightChange, yellow_light_car);
}
void yellow_light_car() {
digitalWrite(greenCar, LOW);
digitalWrite(yellowCar, HIGH);
digitalWrite(redCar, LOW);
digitalWrite(greenWalk, LOW);
digitalWrite(redWalk, HIGH);
t.after(lightChange, red_light_car);
}
void red_light_car() {
digitalWrite(greenCar, LOW);
digitalWrite(yellowCar, LOW);
digitalWrite(redCar, HIGH);
digitalWrite(greenWalk, HIGH);
digitalWrite(redWalk, LOW);
t.after(lightChange, green_light_walk);
}
void green_light_walk() {
digitalWrite(greenCar, LOW);
digitalWrite(yellowCar, LOW);
digitalWrite(redCar, HIGH);
t.oscillate(greenWalk, 50, LOW, 10);
digitalWrite(redWalk, LOW);
t.after(lightChange, red_light_walk);
}
void red_light_walk() {
digitalWrite(greenCar, HIGH);
digitalWrite(yellowCar, LOW);
digitalWrite(redCar, LOW);
digitalWrite(greenWalk, LOW);
digitalWrite(redWalk, HIGH);
t.after(lightChange, interrupcion);
}
You are attaching the interrupt to digital pin 0, which doesn't seem to be connected to anything based on the source code you show. Also in your interrupt service routine, you read the button into the variable buttonState, but you don't access that variable anywhere else in the code.

Openhab doesn't change the status of switch from manual overide

I have just made an account because of this particular problem I'm having with OpenHAB. I was following a tutorial from this https://openhardwarecoza.wordpress.com/2015/03/29/openhab-mqtt-arduino-and-esp8266-part-3-hardware-arduino-with-ethernet-shield/ site but since the reply there didn't help me. I decided to go to this site.
I have successfully installed OpenHAB and use it. When I turn the switch off and on from both the HTTP page and android device, It works just fine. But when I tried to manual override using a push button on an Arduino. It didn't update the state of the switch in both of them. I'm using windows with OpenHAB version 1.71
The Openhab server notices that there is an update of the state from the push button, but the button in the HTTP page and android device didn't change at all.
I have tested the connection using MQTTlens and it works just fine.
Below is my code
items configuration
Group All
Switch mqttsw1 "Switch 1" (all) {mqtt=">[mymosquitto:/arduino/l1/com:command:off:0],>[mymosquitto:/arduino/l1/com:command:on:1],<[mymosquitto:/arduino/l1/state:state:default]"}
Switch mqttsw2 "Switch 2" (all) {mqtt=">[mymosquitto:/arduino/l2/com:command:off:0],>[mymosquitto:/arduino/l2/com:command:on:1],<[mymosquitto:/arduino/l2/state:state:default]"}
Number temp "Temperature [%.1f °C]" <temperature> {mqtt="<[mymosquitto:/arduino/temp/state:state:default]"}
Number hum "Humidity [%.1f &#37]" <temperature> {mqtt="<[mymosquitto:/arduino/hum/state:state:default]"}
Sitemap configuration
sitemap dolphin label="Main Menu"
{
Frame label="Switch" {
Switch item=mqttsw1 label="Switch 1"
Switch item=mqttsw2 label="Switch 2"
}
Frame label="Weather" {
Text item=temp
Text item=hum
}
The Arduino Code
#include <SPI.h>
#include <Ethernet.h>
#include <PubSubClient.h>
#include <DHT.h>
const int butt1 = 3;// the pin that the pushbutton is attached to
const int butt2 = 2;
const int ledPin1 = 5;
const int ledPin2 = 4;
int ledState1 = HIGH;
int buttonState1;
int lastButtonState1 = LOW;
int ledState2 = HIGH;
int buttonState2;
int lastButtonState2 = LOW;
long previousMillis = 0;
unsigned long currentMillis = 0;
long interval = 60000; // READING INTERVAL
int t = 0; // TEMPERATURE VAR
int h = 0; // HUMIDITY VAR
#define DHTPIN 24 // SENSOR PIN
#define DHTTYPE DHT11 // SENSOR TYPE - THE ADAFRUIT LIBRARY OFFERS SUPPORT FOR MORE MODELS
DHT dht(DHTPIN, DHTTYPE);
// Update these with values suitable for your network.
byte mac[] = { 0xDE, 0xED, 0xBA, 0xFE, 0xFE, 0xEF };
IPAddress ip(192, 168, 1, 103);
IPAddress server(192, 168, 1, 100);
void callback(char* topic, byte* payload, unsigned int length);
EthernetClient ethClient;
PubSubClient client(server, 1883, callback, ethClient);
void callback(char* topic, byte* payload, unsigned int length) {
Serial.println();
Serial.println("Callback");
Serial.print("Topic = ");
Serial.println(topic);
Serial.print("Payload = ");
for (int i=0;i<length;i++){
Serial.print((char)payload[i]);
}
Serial.println();
if (strcmp(topic,"/esp1/l1/com")==0) {
if (payload[0] == '0')
{
digitalWrite(ledPin1, LOW);
delay(100);
client.publish("/esp1/l1/state","0");
}
else if (payload[0] == '1')
{
digitalWrite(ledPin1, HIGH);
delay(100);
client.publish("/esp1/l1/state","1");
}
}
if (strcmp(topic,"/esp1/l2/com")==0) {
if (payload[0] == '0')
{
digitalWrite(ledPin2, LOW);
delay(100);
client.publish("/esp1/l2/state","0");
}
else if (payload[0] == '1')
{
digitalWrite(ledPin2, HIGH);
delay(100);
client.publish("/esp1/l2/state","1");
}
}
}
void reconnect() {
// Loop until we're reconnected
while (!client.connected()) {
Serial.print("Attempting MQTT connection...");
// Attempt to connect
if (client.connect("arduinoClient")) {
Serial.println("connected");
client.subscribe("/esp1/#");
client.publish("conn","Connected");
} else {
Serial.print("failed, rc=");
Serial.print(client.state());
Serial.println(" try again in 5 seconds");
// Wait 5 seconds before retrying
delay(5000);
}
}
}
void push1() {
int reading1 = digitalRead(butt1);
buttonState1 = reading1;
if (buttonState1 == HIGH) {
ledState1 = !ledState1;
if (ledState1 < 1)
{
digitalWrite(ledPin1, LOW);
delay(100);
client.publish("/esp1/l1/com","0");
client.publish("/esp1/l1/state","0");
}
else
{
digitalWrite(ledPin1, HIGH);
delay(100);
client.publish("/esp1/l1/com","1");
client.publish("/esp1/l1/state","1");
}
}
}
void push2() {
int reading2 = digitalRead(butt2);
buttonState2 = reading2;
if (buttonState2 == HIGH) {
ledState2 = !ledState2;
if (ledState2 < 1)
{
digitalWrite(ledPin2, LOW);
delay(100);
client.publish("/esp1/l2/com","0");
client.publish("/esp1/l2/state","0");
}
else
{
digitalWrite(ledPin2, HIGH);
delay(100);
client.publish("/esp1/l2/com","1");
client.publish("/esp1/l2/state","1");
}
}
}
void temp() {
h = (int)dht.readHumidity();
t = (int)dht.readTemperature();
char temp[2];
char hum[3];
sprintf(hum, "%d", h);
sprintf(temp, "%d", t);
client.publish("/esp1/temp/state", temp);
client.publish("/esp1/hum/state", hum);
}
void setup() {
// put your setup code here, to run once:
pinMode(butt1, INPUT);
pinMode(butt2, INPUT);
// initialize the LED as an output:
pinMode(ledPin1, OUTPUT);
pinMode(ledPin2, OUTPUT);
Serial.begin(9600);
Ethernet.begin(mac, ip);
digitalWrite(ledPin1, LOW);
digitalWrite(ledPin2, LOW);
pinMode(26, OUTPUT); // sets the digital pin as output
pinMode(22, OUTPUT); // sets the digital pin as output
digitalWrite(26, HIGH); // sets +5v for the sensor
digitalWrite(22, LOW); // sets gnd for the sensor
h = (int)dht.readHumidity();
t = (int) dht.readTemperature();
if (client.connect("arduinoClient")) {
client.publish("conn","Connected");
client.subscribe("/esp1/#");
}
}
void loop() {
// put your main code here, to run repeatedly:
if (!client.connected()) {
reconnect();
}
currentMillis = millis();
if (currentMillis - previousMillis > interval) { // READ ONLY ONCE PER INTERVAL
previousMillis = currentMillis;
temp();
}
int reading1 = digitalRead(butt1);
int reading2 = digitalRead(butt2);
if (reading1 != buttonState1) {
push1();
}
if (reading2 != buttonState2){
push2();
}
client.loop();
}
If there are anybody who can help me I would be very grateful. Thank you for your attention !
Best Regards,
Aldi
If I remember correctly you should post back a status of ON or OFF instead of 1 or 0.
Could you change your arduino code to publish back ON and OFF and test that?
e.g.
client.publish("/esp1/l1/state","ON");

Serial.Available not working on Arduino nano

I have a serial application that runs from a nano into a current loop driver.
Now if I connect the Tx straight to the Rx the led is set to HIGH but if I link the Tx/Rx to the current loop board the LED isnt set at all. I have even added a serial to usb monitor to confirm that the current loop board is returning the same hex as is being passed. Any suggestions?
int timeout = 0;
void setup() {
// put your setup code here, to run once:
pinMode(13, OUTPUT);
Serial.begin(4800,SERIAL_8E1);
//Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
//delay(10000);
byte inByte1 = 0xF1;
byte inByte2 = 0x10;
byte inByte3 = 0xB0;
//if(timeout == 0)
//{
Serial.write(inByte1);
Serial.write(inByte2);
Serial.write(inByte3);
//}
//timeout = timeout+1;
//if(timeout == 50)
//{
// timeout=0;
//}
//delay(80);
byte inByte4 = 0xE1;
//Serial.println(Serial.available());
while (!Serial.available()) {
//timeout =0;
//byte inChar = Serial.read();
//Serial.println(inChar);
//digitalWrite(13, HIGH);
//if(inChar == inByte4)
//{
// digitalWrite(13, HIGH);
//}
Serial.write(inByte1);
Serial.write(inByte2);
Serial.write(inByte3);
delay(80);
}
while (Serial.available()) {
//timeout =0;
//byte inChar = Serial.read();
//Serial.println(inChar);
digitalWrite(13, HIGH);
//if(inChar == inByte4)
//{
// digitalWrite(13, HIGH);
//}
}
}
String ReadResult(Stream &serial)
{
int serialState = 0;
String content = "";
char character;
long interval = 10000;
//unsigned int timeout = 0;
unsigned long currentMillis = millis();
long previousMillis = millis();
while ( !serial.available() && serialState != 1) {
currentMillis = millis();
if(currentMillis - previousMillis > interval){
serialState = 1;
}
}
//timeout = 0;
//while (serial.available()) {
// character = serial.read();
// content += character;
//}
return content;
};
The driver that I was feeding to was not returning thecorrect voltage

Resources