Read potentiometer value in simulink with MBDT blocks

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Read potentiometer value in simulink with MBDT blocks

ソリューションへジャンプ
1,526件の閲覧回数
pierpaolo_dini
Contributor III

Hello,
I was trying to get familiar with MBDT for Simulink.
The board I use is the s32k144.
The objective was to read the potentiometer value and graph it in PIL simulation.
I can actually read when it is at the minimum or the maximum value as if it were a boolean.
My Simulink diagram is as follows:

pierpaolo_dini_0-1656601014918.pngpierpaolo_dini_1-1656601062440.png

in fact, you can see how Simulink suggests that at the GPI Read block output, there is a boolean.

pierpaolo_dini_2-1656601148218.png

I can graph it via scope bl during the simulationock, but I can only see 0 or 1.

any suggestions for reading the entire set of values associated with the potentiometer?

Thanks in advance for the help.

0 件の賞賛
返信
1 解決策
1,507件の閲覧回数
SorinIBancila
NXP Employee
NXP Employee

Hello @pierpaolo_dini ,

The GPIO blocks are digital so they can only read/write logic values (0 and 1). If you want to use the potentiometer, you have to use the ADC (Analog To Digital Converter) blocks. You can check adc examples to see how to use them. 

 

Best regards,

Bancila Sorin

 

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
1,508件の閲覧回数
SorinIBancila
NXP Employee
NXP Employee

Hello @pierpaolo_dini ,

The GPIO blocks are digital so they can only read/write logic values (0 and 1). If you want to use the potentiometer, you have to use the ADC (Analog To Digital Converter) blocks. You can check adc examples to see how to use them. 

 

Best regards,

Bancila Sorin

 

0 件の賞賛
返信