Difference between pins and parameters?

More
25 Jan 2017 16:09 #86636 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?

Please Log in or Create an account to join the conversation.

More
25 Jan 2017 16:54 #86638 by Todd Zuercher
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 or Create an account to join the conversation.

More
25 Jan 2017 17:10 #86639 by rodw
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.
// 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 or Create an account to join the conversation.

More
25 Jan 2017 17:11 #86640 by andypugh
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.

Please Log in or Create an account to join the conversation.

Time to create page: 0.125 seconds
Powered by Kunena Forum