Update README.md

This commit is contained in:
zarpli
2022-05-13 12:58:58 -05:00
committed by GitHub
parent 0485128811
commit 97daa20c09

View File

@@ -107,4 +107,45 @@ return the value of main temperature sensor.
LOGI.main_sensor()
```
# Basic Example
```C++
#include <Z906.h>
// Instantiate a Z906 object and Attach to Serial1
Z906 LOGI(Serial1);
void setup(){
Serial.begin(9600);
while(!Serial);
while(LOGI.cmd(VERSION) == 0)
{
Serial.println("Waiting Z906 Power-Up");
delay(1000);
}
Serial.println("Z906 Version : " + (String) LOGI.request(VERSION));
// Power ON PWM Generator
LOGI.cmd(PWM_ON);
// Select RCA 2.0 Input
LOGI.cmd(SELECT_INPUT_2);
// Disable Mute
LOGI.cmd(MUTE_OFF);
// Set Main Level to 15;
LOGI.cmd(MAIN_LEVEL, 15);
}
void loop(){
Serial.println("Temperature main sensor: " + (String) LOGI.main_sensor());
delay(1000);
}
```