mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-28 02:11:43 +00:00
New netcomms .so and headers.
CAN isn't fully working yet, but this change is necessary to compile for the v9 image. Change-Id: Ife99686a7e7a9979c95ec7a395d597011090fa37
This commit is contained in:
44
wpilibc/wpilibC++IntegrationTests/src/CANJaguarTest.cpp
Normal file
44
wpilibc/wpilibC++IntegrationTests/src/CANJaguarTest.cpp
Normal file
@@ -0,0 +1,44 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* 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 the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "WPILib.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include "TestBench.h"
|
||||
|
||||
class CANJaguarTest : public testing::Test {
|
||||
protected:
|
||||
CANJaguar *m_jaguar;
|
||||
|
||||
virtual void SetUp() {
|
||||
Wait(0.04);
|
||||
m_jaguar = new CANJaguar(TestBench::kCANJaguarID);
|
||||
}
|
||||
|
||||
virtual void TearDown() {
|
||||
delete m_jaguar;
|
||||
}
|
||||
|
||||
void Reset() {
|
||||
m_jaguar->ChangeControlMode(CANJaguar::kPercentVbus);
|
||||
m_jaguar->Set(0.0f);
|
||||
}
|
||||
};
|
||||
|
||||
#if 0
|
||||
TEST_F(CANJaguarTest, Speed) {
|
||||
Reset();
|
||||
|
||||
for(;;) {
|
||||
m_jaguar->Set(1.0f);
|
||||
|
||||
std::cout << "Temperature = " << m_jaguar->GetTemperature() << std::endl;
|
||||
std::cout << "Current = " << m_jaguar->GetOutputCurrent() << std::endl;
|
||||
|
||||
Wait(0.1);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user