Go to Post Want the TL;DR of it? Keep it simple, effective, and easy to use. - Andrew Schreiber [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
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
  #1   Spotlight this post!  
Unread 14-02-2013, 22:44
alberth alberth is offline
Programmer and Engineer
FRC #4067 (The Incredible Hawk)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2011
Location: Maryland
Posts: 9
alberth is an unknown quantity at this point
Outputting PWM on the Digital Sidecar Digital I/O

I'm most familiar with Arduino's PWM interface - basically,
Code:
// Usage: analogWrite(pin, value 0-255)
analogWrite(1, 255);
I'm trying to accomplish this with the FRC Java DigitalOutput class, which seems to contain some methods related to PWM output.

Our situation is that we use a LOT of motors - to the point that we have few (if not zero) PWM slots! Therefore, we are using the Digital I/O GPIO instead, which technically can also output PWM. We are trying to drive a 12 V LED ring that we bought using PWM and an op-amp to ramp the 5 V PWM output to 12 V. We haven't gotten the op-amp nor LED ring yet, so we're currently testing it using the breadboard and a small LED. At the moment, the code looks like this:
Code:
// robotInit
DigitalOutput doutput = new DigitalOutput(1);
doutput.enablePWM(0.0);
// testPeriodic
doutput.updateDutyCycle(1.0);
It does not light up.** The code seems to be correct, since the duty cycle is what affects the LED's brightness... but it doesn't work.

I would appreciate any help!

** I am probably too tired to think/remember, but it *might* be that it did light up - we went from 0.00 to 1.00 by 0.05 increments, going up and down. However, instead of a fading LED, it was just 100% on.
__________________
Team #4067 - The Incredible Hawk
Role: Lead Programmer
Team Website

2012 Rookie Inspiration Award (Chesapeake Regional)

"You can't warm up by standing still in the frigid cold. Get moving!"
Reply With Quote
 


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 11:42.

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