- Posts: 21
- Thank you received: 0
Control GIO pin on P1 expantion
- Bl484
- Topic Author
- Offline
- Junior Member
-
Less
More
2 years 7 months ago - 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
Last edit: 2 years 7 months ago by Bl484.
Please Log in or Create an account to join the conversation.
- tommylight
-
- Away
- Moderator
-
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.
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: 17533
- Thank you received: 5334
2 years 7 months ago - 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
Last edit: 2 years 7 months ago 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.054 seconds