View Single Post
  #1   Spotlight this post!  
Unread 07-04-2014, 21:07
sthreet's Avatar
sthreet sthreet is offline
Registered User
AKA: scott threet
FRC #4692
 
Join Date: Oct 2012
Rookie Year: 2012
Location: Toutle Lake
Posts: 84
sthreet is an unknown quantity at this point
Using multiple classes in java to control one pwm

So I'm trying to figure out how to do multiple classes. This is the strucuture of the classes, where everything in events is a system on the robot.
http://www.chiefdelphi.com/forums/at...5&d=1396919131
The problem is, I put all the pwm stuff in map, so when the second one runs it complains about that pwm already being assigned. How do I get around this?
Here is the error I get, incase I misinterpreted it:
Spoiler for blah:

[cRIO] Uncaught exception in Thread.run():
[cRIO] on thread edu.wpi.first.wpilibj.templates.IO - main
[cRIO] edu.wpi.first.wpilibj.util.AllocationException: PWM channel 1 on module 1 is already allocated
[cRIO] at edu.wpi.first.wpilibj.PWM.initPWM(PWM.java:114)
[cRIO] at edu.wpi.first.wpilibj.PWM.<init>(PWM.java:144)
[cRIO] at edu.wpi.first.wpilibj.SafePWM.<init>(SafePWM.java: 33)
[cRIO] at edu.wpi.first.wpilibj.Talon.<init>(Talon.java:48)
[cRIO] at edu.wpi.first.wpilibj.templates.outputmap.<init>(o utputmap.java:12)
[cRIO] at edu.wpi.first.wpilibj.templates.events.shoot.<init >(shoot.java:8)
[cRIO] at edu.wpi.first.wpilibj.templates.IO.<init>(IO.java: 24)
[cRIO] in virtual method #11 of com.sun.squawk.Klass(bci=53)
[cRIO] at com.sun.squawk.imp.MIDletMainWrapper.main(99)
[cRIO] in virtual method #95 of com.sun.squawk.Klass(bci=25)
[cRIO] at com.sun.squawk.Isolate.run(1506)
[cRIO] at java.lang.Thread.run(231)
[cRIO] in virtual method #47 of com.sun.squawk.VMThread(bci=42)
[cRIO] in static method #3 of com.sun.squawk.VM(bci=6)
Attached Thumbnails
Click image for larger version

Name:	tree.PNG
Views:	67
Size:	13.3 KB
ID:	16785  
__________________
Spoiler for gif:
Reply With Quote