Anonymous
Not applicable
Mar 11, 2017
03:56 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 11, 2017
03:56 PM
How is the best way to call API's with only a different number? Example:
PWM1_Start();
PWM2_Start();
......
PWM12_Start();
OR
PWM1_Stop();
PWM2_Stop();
.....
PWM12_Stop();
like:
for(i=1;i<=12;i++) {
PWM_Stop();
}
Regards,
Michael
1 Reply
Mar 12, 2017
09:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 12, 2017
09:14 AM
Use an array of pointers to functions which you assign the addresses of the needed _Start() and _Stop() functions to. In the program you can use an index into the array to call the respective API. See more here:
Bob