PT2258 Arduino Library
PT2258 Arduino Library

Introduction

This library is to control the 6-Channel Electronic Volume Controller IC PT2258

Github PT2258 Library repository

PT2258 manufacturer specification

PT2258 address

(1: connected to VCC, 0: connected to GND)

CODE1 CODE2 ADDRESS 8bit ADDRESS 7bit
0 0 0x80 0x40
1 0 0x88 0x44
0 1 0x84 0x42
1 1 0x8C 0x46

The Wire library uses addresses with 7bit, so if you perform an I2C scan, the address will appear as right-shifted form the one specified above and in the data sheet. Example: I2C scan finds 0x44 -> this means that the PT2258 has the address 0x88

The default address used by the library is 0x88.

If you need to change it, crete the PT2258 object like this:

PT2258 pt2258(address); // where the address is a 8bit address (check the table for conversion)

Example: PT2258 pt2258(0x84);

Wire connection

The PT2258 is specified to work with a bus clock speed of 100kHz max.

Add Wire.setClock(100000); in the sutup before calling the begin() funtion for the PT2258.

Mute

The PT2258 has the mute on all the channels activated by default when it does power up as a safety measure.

When the mute is active, even if the volume is changed, the channels will remain silent.

Remember to deactivate the mute to ear the sound.

Initial volume

The PT2258 has the volume of all the channels at the maximum when it powers on (and the mute active as well, see "Mute" above).


Author

Created by Marco Lurati, April 21, 2023

License

MIT License

Copyright (c) 2023 marclura

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.