Go to Post I am not short, I am just conveniently packaged. - kio_chan176 [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
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 01-02-2017, 18:22
geosphere geosphere is offline
Registered User
FRC #1825
 
Join Date: Feb 2016
Location: Lee's Summit
Posts: 3
geosphere is an unknown quantity at this point
Programming the Spark Motor Controller C++

I have included the Spark.h header file and I have an if statement on line 168.
When the robot is powered on and enabled the light changes from blinking blue to solid blue but there is no output on the motor side.

Here is the code
Reply With Quote
  #2   Spotlight this post!  
Unread 01-02-2017, 22:05
GeeTwo's Avatar
GeeTwo GeeTwo is online now
Technical Director
AKA: Gus Michel II
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Slidell, LA
Posts: 3,736
GeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond repute
Re: Programming the Spark Motor Controller C++

See page 4 of the Spark manual.

Solid blue means it's getting a signal but is in neutral, so the motor should not be going.
__________________

If you can't find time to do it right, how are you going to find time to do it over?
If you don't pass it on, it never happened.
Robots are great, but inspiration is the reason we're here.
Friends don't let friends use master links.
Reply With Quote
  #3   Spotlight this post!  
Unread 01-02-2017, 23:19
geosphere geosphere is offline
Registered User
FRC #1825
 
Join Date: Feb 2016
Location: Lee's Summit
Posts: 3
geosphere is an unknown quantity at this point
Re: Programming the Spark Motor Controller C++

Yes I meant, that I know it is getting a signal but I can't get it to go forward or backward.
Reply With Quote
  #4   Spotlight this post!  
Unread 02-02-2017, 14:11
GeeTwo's Avatar
GeeTwo GeeTwo is online now
Technical Director
AKA: Gus Michel II
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Slidell, LA
Posts: 3,736
GeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond repute
Re: Programming the Spark Motor Controller C++

Are you pushing the button corresponding to rawButton4?
Is the talon plugged into port 0?

If you think you are and it is, put in some code next to those two set commands (inside the if-then) to send feedback to the driver station (just turning a light red/yellow/green should be enough). This will tell you if you are actually executing that bit of code or not.

If you are executing that code, check your cable and/or try replacing the spark with another one or a talonSR or VictorSP (all close enough to each other for this test).

If you are not executing that code when you push the button, check for a problem on the joystick side. (wrong button, broken wire, etc.) or continue looking for a software problem.
__________________

If you can't find time to do it right, how are you going to find time to do it over?
If you don't pass it on, it never happened.
Robots are great, but inspiration is the reason we're here.
Friends don't let friends use master links.
Reply With Quote
  #5   Spotlight this post!  
Unread 02-02-2017, 16:41
geosphere geosphere is offline
Registered User
FRC #1825
 
Join Date: Feb 2016
Location: Lee's Summit
Posts: 3
geosphere is an unknown quantity at this point
Re: Programming the Spark Motor Controller C++

The spark is plugged into pwm 0

I will try hooking a talon sr up instead, if that doesn't work I'll try adding feedback in the DS.

Also the joystick is fine I have checked it in JoyTester and in the DS, all buttons and sticks work.

Thanks.
Reply With Quote
  #6   Spotlight this post!  
Unread 02-02-2017, 16:48
dvanvoorst dvanvoorst is offline
Registered User
FRC #2771 (Code Red)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Grand Rapids, MI
Posts: 72
dvanvoorst is an unknown quantity at this point
Re: Programming the Spark Motor Controller C++

Try changing your else condition to run the motor in reverse instead of stopped - then you'll have positive indication that things are hooked up and talking. Then it'll be narrowed down to a button issue.

Code:
if(driveStick->GetRawButton(4)) 
{ 
	spark1->Set(1); 
} 
else 
{ 
	spark1->Set(-1); 
}
__________________

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 15:26.

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