blob: ea0c81924a0ef32be67f0626f01fc1a1788aa7d0 [file] [log] [blame]
Brian Silvermanf7f267a2017-02-04 16:16:08 -08001/*----------------------------------------------------------------------------*/
2/* Copyright (c) FIRST 2014-2017. All Rights Reserved. */
3/* Open Source Software - may be modified and shared by FRC teams. The code */
4/* must be accompanied by the FIRST BSD license file in the root directory of */
5/* the project. */
6/*----------------------------------------------------------------------------*/
7
8#pragma once
9
10#include <stdint.h>
11
12#include <memory>
13#include <string>
14
15#include "HAL/AnalogOutput.h"
16#include "LiveWindow/LiveWindowSendable.h"
17#include "SensorBase.h"
18
19namespace frc {
20
21/**
22 * MXP analog output class.
23 */
24class AnalogOutput : public SensorBase, public LiveWindowSendable {
25 public:
26 explicit AnalogOutput(int channel);
27 virtual ~AnalogOutput();
28
29 void SetVoltage(double voltage);
30 double GetVoltage() const;
31 int GetChannel();
32
33 void UpdateTable() override;
34 void StartLiveWindowMode() override;
35 void StopLiveWindowMode() override;
36 std::string GetSmartDashboardType() const override;
37 void InitTable(std::shared_ptr<ITable> subTable) override;
38 std::shared_ptr<ITable> GetTable() const override;
39
40 protected:
41 int m_channel;
42 HAL_AnalogOutputHandle m_port;
43
44 std::shared_ptr<ITable> m_table;
45};
46
47} // namespace frc