Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arduino UNO and serial monitor hangs. #3

Open
rajchips opened this issue Dec 13, 2018 · 3 comments
Open

Arduino UNO and serial monitor hangs. #3

rajchips opened this issue Dec 13, 2018 · 3 comments

Comments

@rajchips
Copy link

rajchips commented Dec 13, 2018

Hi,

It's working now...
Library examples are not correct. All probe assignment should be before "void setup(){"
See below for correct code...

//#include <OneWire.h>
#include <OWBus.h>
#include <OWBus/DS18B20.h>
#include <OWBus/DS2413.h>

#define ONE_WIRE_BUS 7 // Where 1W bus is connected to
OneWire oneWire(ONE_WIRE_BUS); // Initialize oneWire library
OWBus bus(&oneWire);
int count;

DS18B20 probe(bus, 0x282503E00200000B);
DS2413 led(bus, 0x3A34074E0000000A);
DS2413 fan2(bus, 0x3AF3E64D0000008F);

void setup() {
Serial.begin(9600);
delay(100);
count=1;
}

void loop() {
//Serial.println(probe.getTemperature());

if (probe.getTemperature()>=29){
led.setPIOA( false );
led.setPIOB( false );
fan2.setPIOB( true );
}

else{
led.setPIOA( true );
led.setPIOB( true );
fan2.setPIOB( false );
}

//Serial.println(fan2.readPIOs());
//Serial.println(fan2.getPIOB());

delay(500);

//count++;
//Serial.println(count);

bt_upload();

}

@destroyedlolo
Copy link
Owner

Hi, sorry for this late issue (I was busy by other stuffs that leave me away from git :) ).

Do you means it's hanging at the printf line ? If so, I think there is something broken in Serial code as I got the same issue with OneWireArduino lib and it seems something wrong about interruption management in Serial vs other stuffs.

Can you please try with only 1 probe ?

@rajchips
Copy link
Author

rajchips commented Dec 22, 2018 via email

@destroyedlolo
Copy link
Owner

destroyedlolo commented Dec 31, 2018

Ok, so I think there is a memory leak somewhere every time an object is created.
I didn't noticed it as I'm mostly using DeepSleep on my ESP which cause a full restart at every wakeup.
I'll investigate. Thanks for the report.

In addition, Arduinos have a very small memory so creating stack objects is probably not a good idea as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants