Go to Post amazing stuff. - Specialagentjim [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 17-01-2013, 20:24
agartner01 agartner01 is offline
Captain + Control Sys & Design
FRC #4174
Team Role: Engineer
 
Join Date: Feb 2012
Rookie Year: 2012
Location: Hector MN
Posts: 109
agartner01 is an unknown quantity at this point
Re: No Robot Code

Please use the code button when posting code snippets... Try removing the dash->putnumber (and potentially replacing it with a printf). Sometimes interacting with smart dashboard crashes the robot code.

Last edited by agartner01 : 17-01-2013 at 20:34.
Reply With Quote
  #2   Spotlight this post!  
Unread 17-01-2013, 20:29
pfish3138 pfish3138 is offline
Registered User
FRC #3138 (Innovators Robotics)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Dayton
Posts: 8
pfish3138 is an unknown quantity at this point
Re: No Robot Code

#ifndef TEAM3138_PWMREADER_H
#define TEAM3138_PWMREADER_H

#include <WPILib.h>
#include <SmartDashboard/SmartDashboard.h>
#include <PWM.h>

class PWMTester : public PWM
{
public:
explicit PWMTester(UINT32 channel);
PWMTester(UINT8 moduleNumber, UINT32 channel);
virtual ~PWMTester();
void Update();

private:

};

#endif
#include "PWMReader.h"

PWMTester:WMTester(UINT32 channel) : PWM(channel)

{

}

PWMTester:WMTester(UINT8 moduleNumber, UINT32 channel) : PWM(UINT8 moduleNumber, UINT32 channel)

{

}

dash->PutNumber("PWM Output", m_PWMTester.GetRaw());
Reply With Quote
  #3   Spotlight this post!  
Unread 17-01-2013, 20:31
agartner01 agartner01 is offline
Captain + Control Sys & Design
FRC #4174
Team Role: Engineer
 
Join Date: Feb 2012
Rookie Year: 2012
Location: Hector MN
Posts: 109
agartner01 is an unknown quantity at this point
Re: No Robot Code

Code:
#ifndef TEAM3138_PWMREADER_H
#define TEAM3138_PWMREADER_H

#include <WPILib.h>
#include <SmartDashboard/SmartDashboard.h>
#include <PWM.h>

class PWMTester: public PWM {
public:
	explicit PWMTester(UINT32 channel);
	PWMTester(UINT8 moduleNumber, UINT32 channel);
	virtual ~PWMTester();
	void Update();

private:

};

#endif
#include "PWMReader.h"

PWMTester:WMTester(UINT32 channel) : PWM(channel)

{

}

PWMTester:WMTester(UINT8 moduleNumber, UINT32 channel) : PWM(UINT8 moduleNumber, UINT32 channel)

{

}

dash->PutNumber("PWM Output", m_PWMTester.GetRaw());
Click the button then paste your code inbetween [.code] and [/code]

Last edited by agartner01 : 17-01-2013 at 20:35.
Reply With Quote
  #4   Spotlight this post!  
Unread 17-01-2013, 20:32
pfish3138 pfish3138 is offline
Registered User
FRC #3138 (Innovators Robotics)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Dayton
Posts: 8
pfish3138 is an unknown quantity at this point
Re: No Robot Code

Okay. I'm new to Chief Delphi. So, do you have an answer?
Reply With Quote
  #5   Spotlight this post!  
Unread 17-01-2013, 20:35
agartner01 agartner01 is offline
Captain + Control Sys & Design
FRC #4174
Team Role: Engineer
 
Join Date: Feb 2012
Rookie Year: 2012
Location: Hector MN
Posts: 109
agartner01 is an unknown quantity at this point
Re: No Robot Code

Quote:
Originally Posted by pfish3138 View Post
Okay. I'm new to Chief Delphi. So, do you have an answer?
Try removing the dash->putnumber (and potentially replacing it with a printf). Sometimes interacting with smart dashboard crashes the robot code. Also look at the netconsole/ WTX console output for errors.

Edit: as I look at it again, dash-> put number is never actually called. You have to put it in a function/constructor. I think you want:
Code:
void PWMTester::Update
{
     dash->PutNumber("PWM Output", m_PWMTester.GetRaw());
}
I'm not sure if it was initialized somewhere else, but looking at this snippet, "dash" was never declared... Although I'm not exactaly sure what your trying to do here. The default victor class values should work, shouldn't they?

Last edited by agartner01 : 17-01-2013 at 20:54.
Reply With Quote
  #6   Spotlight this post!  
Unread 17-01-2013, 20:37
pfish3138 pfish3138 is offline
Registered User
FRC #3138 (Innovators Robotics)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Dayton
Posts: 8
pfish3138 is an unknown quantity at this point
Re: No Robot Code

The problem is that we're trying to read the output values from smart dashboard. I'd like to try to get it to work with it, but I'll try.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 20:56.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi