Arduino Internal Pull Up Mode in Simulink

조회 수: 24 (최근 30일)
Cou
Cou 2018년 3월 24일
댓글: Hans Scharler 2018년 4월 8일
Is there a way to set the pin mode to pull up in Simulink? I see there is a method in MATLAB:
a = arduino('COM4','Uno');
configurePin(a,'D3','pullup');
How would I set this for my Simulink model? Thanks!
  댓글 수: 2
Hans Scharler
Hans Scharler 2018년 3월 27일
편집: Hans Scharler 2018년 3월 27일
I will find someone to help you with this. What are you building?
Cou
Cou 2018년 3월 27일
Hi Hans, Thanks. I am using the Sparkfun CAN BUS shield. The joystick requires pullups. Prior to configuring pins for pull up, you would configure them in Arduino IDE as
pinMode(A1,INPUT);
digitalWrite(A1, HIGH);
This is not an option since you cannot read and write to the same pin at the same time in Simulink.

댓글을 달려면 로그인하십시오.

채택된 답변

Cou
Cou 2018년 4월 8일
I created a custom device driver to solve my problem. The block can be found here: Arduino Pinmode Input Pull Up

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Modeling에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by