Control GIO pin on P1 expantion

More
2 years 7 months ago #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:
  
 
Code:
setp hm2_7i96.0.gpio.035.out 1
and
Code:
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

Please Log in to join the conversation.

More
2 years 7 months ago #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.

Please Log in to join the conversation.

More
2 years 7 months ago #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
 

Please Log in to join the conversation.

Time to create page: 0.070 seconds
Powered by Kunena Forum