Control GIO pin on P1 expantion

More
21 Mar 2024 22:29 - 21 Mar 2024 23:00 #296512 by Bl484
Hi, I am using a 7i96s board and have connected a LED to pin GIO35 on the P1 expansion connector. My intention is to control this LED by sending HAL commands. I've attempted to turn the LED on and off using the following commands:
  
 
setp hm2_7i96.0.gpio.035.out 1
and
setp hm2_7i96.0.gpio.035.out 0
When observing the pin indicator in the HAL watch menu, I notice it toggles on and off as expected. However, despite this, the voltage of the pin itself does not change, resulting in the LED remaining constantly lit.Could you please advise me on how to properly control a GIO pin and resolve this issue? Thanks
Last edit: 21 Mar 2024 23:00 by Bl484.

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

More
21 Mar 2024 23:07 #296516 by tommylight
Pretty sure the GPIO pins must be set as outputs first, then can be toggled.
Sorry but i have no example of it, only normal outputs on screw terminals.
The following user(s) said Thank You: Bl484

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

More
22 Mar 2024 02:07 - 22 Mar 2024 02:08 #296527 by PCW
Replied by PCW on topic Control GIO pin on P1 expantion
Yes, GPIO pins default to inputs so you must enable them
to be outputs, something like:

setp hm2_7i96s.0.gpio.035.is_output true
 
Last edit: 22 Mar 2024 02:08 by PCW.
The following user(s) said Thank You: tommylight, zz912

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

More
22 Mar 2024 07:02 #296536 by yohannathomas

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

Time to create page: 0.152 seconds
Powered by Kunena Forum