Arduino Internal Pull Up Mode in Simulink

16 visualizaciones (últimos 30 días)
Cou
Cou el 24 de Mzo. de 2018
Comentada: Hans Scharler el 8 de Abr. de 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 comentarios
Hans Scharler
Hans Scharler el 27 de Mzo. de 2018
Editada: Hans Scharler el 27 de Mzo. de 2018
I will find someone to help you with this. What are you building?
Cou
Cou el 27 de Mzo. de 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.

Iniciar sesión para comentar.

Respuesta aceptada

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

Más respuestas (0)

Categorías

Más información sobre Modeling en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by