View Single Post
  #2   Spotlight this post!  
Unread 23-09-2014, 22:29
shadowfios shadowfios is offline
Registered User
FRC #2046
 
Join Date: Feb 2013
Location: United States
Posts: 3
shadowfios is an unknown quantity at this point
Re: Arduino with Robot-Open programming help

I assume you mean port 8 on the relay shield, as there is no port 9.
you would have to add:
Code:
ROSolenoid solenoid(9);
before your enabled() function. The 9 is because Robot-Open 0-indexs ports.
you would also need to add:
Code:
if (usb1.btnA())    
solenoid.on();
else
solenoid.off();
inside the enabled() function.
This would cause the solenoid to mimic the button presses.
However I cannot test this code as I do not have the hardware myself.
also is it necessary for the burst to be 1 second?