45 lines
842 B
Arduino
Raw Normal View History

2022-02-21 19:40:59 +01:00
//
// FILE: Cozir_echo.ino
// AUTHOR: Rob Tillaart
// PURPOSE: demo of Cozir sensor
// URL: https://github.com/RobTillaart/Cozir
//
2022-03-04 15:07:12 +01:00
// NOTE: this sketch needs a MEGA or a Teensy that supports a second
2022-02-21 19:40:59 +01:00
// Serial port named Serial1
// The purpose of this sketch is to talk lowest level to the COZIR sensor.
// one can send the low level commands (datasheet) directly to the device.
2022-03-04 15:07:12 +01:00
// NOTE: this can cause (unwanted) side effects, so use with care.
2022-02-21 19:40:59 +01:00
#include "Arduino.h"
#include "cozir.h" // not perse needed
COZIR czr(&Serial1);
void setup()
{
Serial1.begin(9600);
2022-02-25 12:16:35 +01:00
Serial.begin(115200);
2022-02-21 19:40:59 +01:00
Serial.println(__FILE__);
Serial.println();
}
void loop()
{
if (Serial.available())
{
Serial1.write(Serial.read());
}
if (Serial1.available())
{
Serial.write(Serial1.read());
}
}
// -- END OF FILE --