cancel
Showing results for 
Search instead for 
Did you mean: 

Code Examples

Anonymous
Not applicable

I am a new and i am trying to solve this.

0 Likes
Reply
1 Solution
Esteemed Contributor

Hi,

Attached is my trial.

But if this is an assignment at your class,

please try it by yourself first 😉

moto

View solution in original post

0 Likes
Reply
5 Replies
Esteemed Contributor II

You have 5 different states, a "switch" statement may cover all those. Set in the (debounced) button interrupt handler a global variable which you check in the infinite main loop. When set, advance to next LED-state and reset the variable.

Which kind of hardware are you using? Kit ?? Which one???

Bob

0 Likes
Reply
Honored Contributor II

meemo,

I recomment to start with simple button switch example for KIT-042, which you can find here:

ButtonSw32: button switch debouncer component

Start with PSoC4 basic example, which has 3 buttons and 3 onboard LED. Once it works, add extra code (like if..then..else) to modify for your need.

ButtonSw_P4_basic_1a.png

0 Likes
Reply
Esteemed Contributor

Hi,

Attached is my trial.

But if this is an assignment at your class,

please try it by yourself first 😉

moto

View solution in original post

0 Likes
Reply
Top labels