Jump to content

TM4C123 ON-OFF Inputs-outputs

Recommended Posts

Hi Forum,

   I'm designing a simple ON-OFF state GPIO using TM4C123GXL. I'm using Energia for coding since I'm not expert programmer. Step 1: After Pushbutton2 (SW2) turns ON/OFF Blue-Red-Green LEDs. Step 2 : Once step1 is complete pushbutton1 (SW1) is pressed and some GPIO (I choose PIN33=PD_6) has to go ON/OFF by some time. Well Step 1 runs perfect, but I can't make work step 2. Only if I run step 2 separately works OK. Step 2 is basically Pushbutton program; instead use a LED output I use PIN33=PD_6 and I'm able to read HIGH-LOW voltages with multimeter. Any help, I will appreciate. Thank you.


Link to post
Share on other sites

Hello @@EngApache


I don't see a way for the function handle() to be reached.  It is outside loop() and you do not call it.  Look at these two lines closely and see if you spot an error:

  buttonState1 = digitalRead(buttonP1);          // Read the state of SW1
    if (buttonP1 == LOW) {                           // if SW is pressed or not then ....

Also note that a LED is turned on when the output is HIGH - not when it is LOW.


EDIT:  One more thing - make sure you have set all pins where an output is desired as OUTPUT.  One variable is defined as a constant and as a #define.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...