Skip to content

Arduino UNO and serial monitor hangs. #3

Description

@rajchips

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();

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions