|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
How to write Notifier help!!
OK im trying to write a notifier class to cause a delay in my program where one task would be preformed after another with a specific delay.
I get to the part where i named what the notifier is but when the little box appears after i put the name then -> the box says Notifier(TimerEventHandler handler, void *param) Now i dont know whatvalues to put in or what any of this means Any documentation or code any one could give me to simply write a notifier would be much appreciated |
|
#2
|
||||
|
||||
|
Re: How to write Notifier help!!
I'll post some help later tonight.
|
|
#3
|
||||
|
||||
|
Re: How to write Notifier help!!
First you write a function that does whatever you want to do after the notifier delay. Say you want to activate a solenoid after the delay. The Notifier calls a function that takes a void pointer as an argument. We'll pass it a pointer to our solenoid and cast it back in the function so we can use it.
Here's the function: Code:
void SolenoidDelayEventHandler(void* param)
{
//Cast the pointer back to the solenoid type
Solenoid* sol = (Solenoid*)param;
//Activate the solenoid
sol->Set(true);
}
Code:
//As a member of your robot class, Notifier solenoidNotifier; //Then in the constructor of your robot class solenoidNotifier(SolenoidDelayEventHandler, &mySolenoid) //assuming mySolenoid is declared statically in the robot class as well //and not with the keyword new Code:
solenoidNotifier.StartSingle(time); Any questions? |
|
#4
|
||||
|
||||
|
Re: How to write Notifier help!!
Yes.
I just downloaded the WPILibSource20100107.zip because I am curious how they implemented the notifiers. Is that the latest library source from WPI as far as you know? THX! |
|
#5
|
||||
|
||||
|
Re: How to write Notifier help!!
Quote:
As far as how notifiers work, they seem to work on an interrupt level (I'm assuming through a hardware timer run in the FPGA). This is just a guess from glancing over the header file; anyone can feel free to confirm or correct me here. |
|
#6
|
||||
|
||||
|
Re: How to write Notifier help!!
I still need help with the notifier if anyone else has info
kinda close to ship date ![]() |
|
#7
|
||||
|
||||
|
Re: How to write Notifier help!!
Quote:
http://first.wpi.edu/Images/CMS/Firs...te20100217.exe |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to write a good proposal and sponsorship letter for a event | alanelf | Fundraising | 17 | 03-05-2011 06:58 |
| Notifier fixes (impacting PIDController) | heydowns | C/C++ | 0 | 05-02-2009 11:06 |
| Notifier Class | Phoenix Spud | Programming | 0 | 26-01-2009 20:16 |
| How long to understand camera and write useful code | RGuindon | Programming | 3 | 16-12-2007 01:37 |
| How to write image data to binary PGM file format(P5)? | tommy_chai | Programming | 0 | 08-10-2007 08:22 |