Serial Wombat Arduino Library

Loading...
Searching...
No Matches
PCB0042_LSD.h
Go to the documentation of this file.
1#pragma once
2/*
3 Copyright 2026 Broadwell Consulting Inc.
4
5"Serial Wombat" is a registered trademark of Broadwell Consulting Inc. in
6 the United States. See SerialWombat.com for usage guidance.
7
8 Permission is hereby granted, free of charge, to any person obtaining a
9 copy of this software and associated documentation files (the "Software"),
10 to deal in the Software without restriction, including without limitation
11 the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 and/or sell copies of the Software, and to permit persons to whom the
13 Software is furnished to do so, subject to the following conditions:
14
15 The above copyright notice and this permission notice shall be included in
16 all copies or substantial portions of the Software.
17
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
22 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
23 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24 OTHER DEALINGS IN THE SOFTWARE.
25*/
29#include "SerialWombat.h"
30
31
49
50 class PCB0042_LSD_PWM: public SerialWombatChip
51{
52 public:
53 PCB0042_LSD_PWM() : SerialWombatChip(),vinMeas(*this),
54 output0(*this),output1(*this),output2(*this),output3(*this),output4(*this),output5(*this),output6(*this),output7(*this)
55 {}
56
57 SerialWombatChip sw;
58 SerialWombatAnalogInput_18AB vinMeas;
59 SerialWombatPWM_18AB output0,output1,output2,output3,output4,output5,output6,output7;
60
61 SerialWombatPWM_18AB* outputArray[8] = { &output0,&output1,&output2,&output3,&output4,&output5,&output6,&output7};
62
63
73 int16_t begin(uint8_t i2cAddress, bool measureVin = false)
74 {
75 sw.begin(Wire, i2cAddress, false);
76
77
78 for (int i = 0; i < 8; ++i)
79 {
80 outputArray[i]->begin((uint8_t)i);
81
82 }
83
84 if (measureVin)
85 {
86 vinMeas.begin(1);
87 }
88 return (0);
89 }
90
91
92
93
94
95 uint16_t readVin_mV()
96 {
97 return((uint16_t) (vinMeas.readAveraged_mV() * 11));
98
99 }
100
101};
102
SerialWombat.h
PCB0042_LSD_PWM::outputArray
SerialWombatPWM_18AB * outputArray[8]
Definition PCB0042_LSD.h:61
PCB0042_LSD_PWM::output4
SerialWombatPWM_18AB output4
Definition PCB0042_LSD.h:59
PCB0042_LSD_PWM::output6
SerialWombatPWM_18AB output6
Definition PCB0042_LSD.h:59
PCB0042_LSD_PWM::output0
SerialWombatPWM_18AB output0
Definition PCB0042_LSD.h:59
PCB0042_LSD_PWM::output7
SerialWombatPWM_18AB output7
Definition PCB0042_LSD.h:59
PCB0042_LSD_PWM::PCB0042_LSD_PWM
PCB0042_LSD_PWM()
Definition PCB0042_LSD.h:53
PCB0042_LSD_PWM::sw
SerialWombatChip sw
Definition PCB0042_LSD.h:57
PCB0042_LSD_PWM::output5
SerialWombatPWM_18AB output5
Definition PCB0042_LSD.h:59
PCB0042_LSD_PWM::output1
SerialWombatPWM_18AB output1
Definition PCB0042_LSD.h:59
PCB0042_LSD_PWM::output3
SerialWombatPWM_18AB output3
Definition PCB0042_LSD.h:59
PCB0042_LSD_PWM::begin
int16_t begin(uint8_t i2cAddress, bool measureVin=false)
Initialize a PCB0042_LSD pcb on a given I2C address.
Definition PCB0042_LSD.h:73
PCB0042_LSD_PWM::output2
SerialWombatPWM_18AB output2
Definition PCB0042_LSD.h:59
PCB0042_LSD_PWM::readVin_mV
uint16_t readVin_mV()
Definition PCB0042_LSD.h:95
PCB0042_LSD_PWM::vinMeas
SerialWombatAnalogInput_18AB vinMeas
Definition PCB0042_LSD.h:58
SerialWombatAnalogInput_18AB
This class extends SerialWombatAnalogInput with SW18AB specific capabilities.
Definition SerialWombatAnalogInput.h:317
SerialWombatChip::SerialWombatChip
SerialWombatChip()
Definition SerialWombat.cpp:31
SerialWombatPWM_18AB
Extends the SerialWombatPWM class with SW18AB specific functionality, including SerialWombatAbstractS...
Definition SerialWombatPWM.h:149