Control GIO pin on P1 expantion
- Bl484
- Offline
- Junior Member
Less
More
- Posts: 21
- Thank you received: 0
21 Mar 2024 22:29 - 21 Mar 2024 23:00 #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:
andWhen 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
setp hm2_7i96.0.gpio.035.out 1
setp hm2_7i96.0.gpio.035.out 0
Last edit: 21 Mar 2024 23:00 by Bl484.
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19456
- Thank you received: 6520
21 Mar 2024 23:07 #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.
The following user(s) said Thank You: Bl484
Please Log in or Create an account to join the conversation.
- PCW
- Offline
- Moderator
Less
More
- Posts: 17935
- Thank you received: 4809
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
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.
Time to create page: 0.055 seconds