Go to Post You heard it here first folks. The robot will definitely need wheels and will probably have an arm. - DampRobot [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 17-05-2010, 18:45
mjgard's Avatar
mjgard mjgard is offline
Michael
AKA: Michael Gard
FRC #2844 (Stampede Robotics)
Team Role: Teacher
 
Join Date: Oct 2007
Rookie Year: 2007
Location: Laveen,AZ
Posts: 74
mjgard will become famous soon enough
Programming EasyC

I am trying to use a digital I/O on the vex microcontroller to control a spike. Can someone help me with the programming. I understand all the drive functions, but dont understand how to use the digital to turn a spike on and off in easyC.

Thanks
__________________
Michael
Stampede Robotics Mentor
FRC 2844

2012 Arizona Regional --Judges' Award
2012 Las Vegas Regional -- Regional Winners
2012 Las Vegas Regional-- Coopertition Award
2009 Arizona Regional -- Rookie All Star Award
  #2   Spotlight this post!  
Unread 18-05-2010, 02:23
RyanCahoon's Avatar
RyanCahoon RyanCahoon is offline
Disassembling my prior presumptions
FRC #0766 (M-A Bears)
Team Role: Engineer
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Mountain View
Posts: 689
RyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond repute
Re: Programming EasyC

I don't know easyC, but I assume you know how to control digital outputs.

Referencing the Users Guide on the Spike product info page, the input cable to the Spike is wired so that the White (or Yellow or Orange) wire is the Forward signal, the Red wire is the Reverse signal, and the Black wire is ground. So you'll need to use two digital outputs and create a cable like such:
Code:
                 ,--W   \
                 |  R   |  digital output 1
                 |  B   /
         /  W----'       
to Spike |  R----.       
         \  B--. '--W   \
               |    R   |  digital output 2
               '----B   /

W,R,B = White, Red, Black
It might end up looking like a PWM Y-cable, but it is different. Then set the digital inputs as specified in the Users Guide to direct the spike into either Off, Forward, Reverse, or Brake modes.

Hope that answers your question

--Ryan
__________________
FRC 2046, 2007-2008, Student member
FRC 1708, 2009-2012, College mentor; 2013-2014, Mentor
FRC 766, 2015-, Mentor
  #3   Spotlight this post!  
Unread 18-05-2010, 10:15
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,856
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Programming EasyC

Using Ryan's wiring the code might look something like this:
Code:
Channel5=Get RxInput (1,5);
Channel6=Get RxInput (1,5);
 
if (Channel5 == 1) {
    // forward
    Set Digital Output (1,1);
    Set Digital Output (2,0);
} else if (Channel6 == 1) { 
    // reverse
    Set Digital Output (1,0);
    Set Digital Output (2,1);
} else {
    // stop
    Set Digital Output (1,0);
    Set Digital Output (2,0);
}
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
  #4   Spotlight this post!  
Unread 19-05-2010, 14:05
mjgard's Avatar
mjgard mjgard is offline
Michael
AKA: Michael Gard
FRC #2844 (Stampede Robotics)
Team Role: Teacher
 
Join Date: Oct 2007
Rookie Year: 2007
Location: Laveen,AZ
Posts: 74
mjgard will become famous soon enough
Re: Programming EasyC

thank you both, i will try this.
__________________
Michael
Stampede Robotics Mentor
FRC 2844

2012 Arizona Regional --Judges' Award
2012 Las Vegas Regional -- Regional Winners
2012 Las Vegas Regional-- Coopertition Award
2009 Arizona Regional -- Rookie All Star Award
Closed Thread


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
EasyC Pro Programming? Gizmo2417 General Forum 6 04-02-2008 01:08
EasyC Vex Programming help in RC Mode tommytalks Programming 7 06-12-2007 17:36
Programming help. EasyC Vex Robot. OneCoolDude Programming 2 02-12-2007 17:54
EDU programming with easyC SgtMillhouse648 Programming 4 11-07-2007 15:58
Arrays in Vex Programming Kit EasyC? gblake FIRST Tech Challenge 9 12-09-2006 17:05


All times are GMT -5. The time now is 23:17.

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