mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
22 lines
726 B
C++
22 lines
726 B
C++
|
|
/*----------------------------------------------------------------------------*/
|
||
|
|
/* Copyright (c) FIRST 2014. All Rights Reserved. */
|
||
|
|
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||
|
|
/* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */
|
||
|
|
/*----------------------------------------------------------------------------*/
|
||
|
|
|
||
|
|
#include "WPILib.h"
|
||
|
|
#include "gtest/gtest.h"
|
||
|
|
#include "TestBench.h"
|
||
|
|
|
||
|
|
TEST(CANTalonTest, QuickTest) {
|
||
|
|
CANTalon talon(0);
|
||
|
|
talon.SetControlMode(CANSpeedController::kPercentVbus);
|
||
|
|
talon.EnableControl();
|
||
|
|
talon.Set(1.0);
|
||
|
|
Wait(0.25);
|
||
|
|
EXPECT_GT(talon.GetOutputCurrent(), 0.0);
|
||
|
|
|
||
|
|
talon.Set(0.0);
|
||
|
|
talon.Disable();
|
||
|
|
}
|