Arduino Internal Pull Up Mode in Simulink

22 views (last 30 days)
Cou
Cou on 24 Mar 2018
Commented: Hans Scharler on 8 Apr 2018
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 Comments
Cou
Cou on 27 Mar 2018
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.

Sign in to comment.

Accepted Answer

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

More Answers (0)

Community Treasure Hunt

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

Start Hunting!