- Posts: 21
- Thank you received: 0
Control GIO pin on P1 expantion
2 years 7 months ago #296512
by Bl484
Control GIO pin on P1 expantion was created 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:
and
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
Code:
setp hm2_7i96.0.gpio.035.out 1
Code:
setp hm2_7i96.0.gpio.035.out 0
Please Log in to join the conversation.
- tommylight
-
- Offline
- Administrator
-
Less
More
- Posts: 22010
- Thank you received: 3
2 years 7 months ago #296516
by tommylight
Replied by tommylight on topic Control GIO pin on P1 expantion
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.
Sorry but i have no example of it, only normal outputs on screw terminals.
Please Log in to join the conversation.
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
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
