- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello all,
I have coded for the simple buttons on the PSoC 4 Pioneer Board, using the onboard slider elements as Buttons. It has compiled & build OK;
Then I programmed the board, successfully. The output was tuned to respective LED's on board (Red, Yellow, Blue);
But the problem I have is:
1. It isn't holding the output i.e. I want a Toggled output but it just turns ON when touched & turns OFF when finger is removed.
What should get me out of it?
2. Also can I have Percentile illumination to the LED's @ OFF state (20%) & ON state (100%) like it was in Ez-Click?
Thanks & Regards-
Amit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1, You have to do the toggling yourself. Whenever there is a completed button access (finger - no finger) you should toggle a variable to indicate the new state.
2. Use a PrISM component to control brightness of an LED. Documented in its datasheet and examples available.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Bob, Greetings.
I tried with an variable to hold the LED status but facing some issues:
Try 1 : Behaves same as without the variable.
Try 2 : Holds the o/p status permanent, I need to reset to bring it down.
Attached is the file with both modifications.
Please guide to better results.
Thanks & Regards-
Amit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry, Amit, I cannot do anything with a text-file. Please always use Creator -> File -> Create Workspace Bundle
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are thinking too complicated. I made some changes to your project to ease program flow:
- Some relevant #defines
- Initialization
- Renaming the flags, so they correspond to the LEDs (would be fine to change the name to "LEDState)
- removing the else-parts
- changing the logic
Didn't test, but should run
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey Bob,
I tried your archive, but it was giving similar o/p to my Try 2 case i.e.
It light's up a LED but could not turn it off. Need to RESET to do so.
Please have it checked & help with sorted.
Thanks & Regards-
Amit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content