EngApache 0 Posted August 28, 2015 Share Posted August 28, 2015 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. Blink338.ino Quote Link to post Share on other sites
Fmilburn 445 Posted August 28, 2015 Share Posted August 28, 2015 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. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.