Go to Post Logic has no place here whatsoever. - ThamiorLianodel [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #14   Spotlight this post!  
Unread 17-01-2013, 13:30
jamie_1930's Avatar
jamie_1930 jamie_1930 is offline
Registered User
FRC #2228 (Cougartech)
Team Role: Student
 
Join Date: Feb 2008
Rookie Year: 2008
Location: Rush-Henrietta
Posts: 371
jamie_1930 is a splendid one to beholdjamie_1930 is a splendid one to beholdjamie_1930 is a splendid one to beholdjamie_1930 is a splendid one to beholdjamie_1930 is a splendid one to beholdjamie_1930 is a splendid one to beholdjamie_1930 is a splendid one to behold
Re: CIM->Victor 884->Arduino not working

Quote:
Originally Posted by tr6scott View Post
This is working code, I have two pots, one is set only goes one direction, the other pot goes full rev -> 0 -> full forward. This was hacked together a couple of years ago, and put in an Altoids can, we are using it to prototype again this year.

Code:
#include <Servo.h> 
 
Servo myservo;  // create servo object to control a servo 
Servo myservo1;  // create servo object to control a servo 
 
int potpin = 0;  // pot in is 13 pwm analog pin used to connect the potentiometer
int potpin1 = 1;  // analog pin used to connect the potentiometerint val;    // variable to read the value from the analog pin 
int val =0;
int val1=0;
void setup() 
{ 
 myservo.attach(9);  // attaches the servo on pin 9 to the servo object 
 myservo1.attach(10);  // attaches the servo on pin 9 to the servo object 
} 
 
void loop() 
{ 
  val = analogRead(potpin);            // reads the value of the potentiometer (value between 0 and 1023) //
  val1 = analogRead(potpin1);            // reads the value of the potentiometer (value between 0 and 1023) 
  val = map(val, 0, 1023, 0, 179);     // scale it to use it with the servo (value between 0 and 180) 
  val1 = map(val1, 0, 1023, 90, 179);     // scale it to use it with the servo (value between 0 and 180) 
   myservo.write(val);                  // pwm 13 sets the servo position according to the scaled value 
   myservo1.write(val1);                  // sets the servo position according to the scaled value 
  delay(15);                           // waits for the servo to get there 
}
Could you show me how you set up this up electrically? In the victor manual it says to use a pwm signal driver if you are not using an ifi controller and I can't really find one on the internet. So I assumed I could boost up the amount of current by using a mosfet. I got that working and then I measured the current over time with an oscilliscope and it's pretty noisy. The voltage is a perfect square wave, but the current starts of at 0A and curves up to around 500mA and does a 10-20mA bounce as it goes up.
__________________
2010
Team 2228(FRC) - Drive Team Lead, Drive Coach, Mechanical Team
Team 3750(FTC) - Team Lead
2009
Team 2228(FRC) - Mechanical Team, Driver at RIT, and Hartford Regionals, and Drive coach at Ruckus
*Second Place at Ruckus
Team 3750(FTC) - Team Lead, and Drive coach at Clarkson Regional
*Second Place at Clarkson Regional
2008
Team 1930(FRC) - Worked on Mechanical, Electrical, and Programming.
 


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 00:18.

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