|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Gyro code causes a crash
The code below causes the crio FRC program to crash. Anyone know why:
CONFIGURATION: One KOP gyro hooked up to port 6 of the analog break out. The module is on slot 1. I tried passing the slot number 1 in, but it made no difference. CODE: class RobotDemo : public SimpleRobot { Gyro TheGyro; public: RobotDemo(void): TheGyro(6) { float TheAngle = TheGyro.GetAngle(); printf("The Angle is %f \n", TheAngle); } CONSOLE OUTPUT: >>>>ERROR: A parameter is out of range.: moduleNumber and/or channel (must be accumulator channel) ...in InitGyro() in C:/WindRiver/workspace/WPILib/Gyro.cpp at line 32 dDistance is 21.347803 program Exception current instruction address: 0x00000000 Machine Status Register: 0x0008b012 Condition Register: 0x28000484 Task: 0x11e49e8 "FRC_RobotTask" 0x11e49e8 (FRC_RobotTask): task 0x11e49e8 has had a failure and has been stopped. 0x11e49e8 (FRC_RobotTask): fatal kernel task-level exception! |
|
#2
|
|||
|
|||
|
Re: Gyro code causes a crash
The gyro can only be used with the channels that have an accumulator assigned to them in FPGA. I believe this is currently channels 1 and 2 on slot 1 (I know Slot 1 channel 1, I believe the other is on slot 1 channel 2)
|
|
#3
|
||||
|
||||
|
Re: Gyro code causes a crash
awesome! that did it, thanks.
However, I got back 1784.183105 What is that suppose to be? |
|
#4
|
||||
|
||||
|
Re: Gyro code causes a crash
It's working ok, not sure why I got that big value at first.
|
|
#5
|
||||
|
||||
|
Re: Gyro code causes a crash
Probably because you didn't reset the accumulator right away.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|