- Posts: 60
- Thank you received: 0
Difference between pins and parameters?
9 years 9 months ago #86636
by Wirewrap
Difference between pins and parameters? was created by Wirewrap
When writing my own little HAL components, I have so far only used pins.
Is there anything a parameter can do that a pin can't do?
Is there anything a parameter can do that a pin can't do?
Please Log in to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
-
Less
More
- Posts: 4739
- Thank you received: 2
9 years 9 months ago #86638
by Todd Zuercher
Replied by Todd Zuercher on topic Difference between pins and parameters?
As far as I know the main difference is a parameter can not be connected to a hal signal. Hopefully someone more knowledgeable will give more detail.
Please Log in to join the conversation.
9 years 9 months ago #86639
by rodw
Replied by rodw on topic Difference between pins and parameters?
Some Components have values that need to be set before use. Thats what parameters do. Usually they don't ever need to be changed. For an example, look at the THC component. It is for use with the Mesa THCAD hardware. Each of these boards is individually calibrated and the calibration data is applied to a sticker attached to the board.
So paramaters are used to set this calibration data as shown in thic code excerpt.
So paramaters are used to set this calibration data as shown in thic code excerpt.
Code:
// Parameters
param rw float vel_scale "The scale to convert the Velocity signal to Volts";
param rw float scale_offset "The offset of the velocity input at 0 volts";
Please Log in to join the conversation.
9 years 9 months ago #86640
by andypugh
Replied by andypugh on topic Difference between pins and parameters?
Parameters use up fractionally less shared-memory. This used to matter, but rarely does now.
Whenever you think that somthing should be a parameter because nobody would ever want to change it at run-time, you are probably wrong.
Whenever you think that somthing should be a parameter because nobody would ever want to change it at run-time, you are probably wrong.
Please Log in to join the conversation.
Time to create page: 0.079 seconds
