mirror of
https://github.com/sascha-hemi/Logitech-Z906.git
synced 2026-03-21 03:03:47 +01:00
Update README.md
This commit is contained in:
41
README.md
41
README.md
@@ -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);
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user