Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

You are here: Forum Home → ANT+ Forums → ANT+ Fitness Equipment → Thread

   

Sample code to write resistance to bike trainer

Rank

Total Posts: 12

Joined 2022-10-27

PM

Hi,
I want to use the FE-C profile to write resistance to my bike trainer.
Till now I was able to read the bike speed and power using bike speed and cadence profile and bike power profile. Because I am noob in this level of programming I used the “ANT PC SDK - API Libraries and sample source code “ to read the bike speed and power output.
What I did is just to change the channel period and device type inside the “DEMO_HR_RECEIVER” based on the speed and power device profile and then interpret the received which was quite simple.
Now I am struggling to be able to write resistance to my Bike trainer. I read the document FE-C but still don’t understand in what part of the code I can write a number as resistance.
Based the FE-C device profile document, I configure the channel (slave channel in table 7-1).

But where should I write the resistance, could you provide me a sample code (in C++) like the DEMO_HR_RECEIVER please.
If you could provide me a simple demo code like DEMO_HR_RECEIVER that would be nice.
I appreciate any help,
Thanks.


     
Rank

Total Posts: 12

Joined 2022-10-27

PM

As I'm reading more, and testing SimulANT+ software, I figured out that I need to setup a slave channel and while I am receving RX from the bike trainer, I sent an Acknowleged message (to set the resistance of bike).
So I appreciate if you can give me an example. I'm looking inside the DEMO_HR_RECEIVER project code, but still can't figure out how to implement this task to send an acknowledged message.

Thanks in advance.