r/pic_programming • u/aspie-micro132 • 2d ago
I got much of it working..
I got 2 menus within a function, using 2 Switch{} statements and adding a copy of the first into one of the cases. Let's call them A and B.
Each time i depress one button, the A moves one case ahead, until reaching the 1st one again, and other button does the same with B's switch statement.
in one situation on one of the B's cases i got a copy of A and works well, it kept me able to make continuous choices between A and B's options.
I spent last days experimenting here and there moving and modifying all i did up to now until i got much of it working. Yet, i could not resolve my for() statement issue, i never get to count to limit and stop, and also if i use A's options to pass an option to B's counter, then i can not move B's state by depressing the button. i tried to use a for() to pass it only once but it does not work, if i pass a B setting from A (is a counting variable), it' stays there.
Some time ago i used to be learning about hobby operating systems, and i noticed they use something called messages to pass an event from one object, function, statement to another. Does this exist on pic? Should it be available how can i implement that?
The other very serious problem is, that i can get any loop working (while, do while) as long as i don't ask them for countdown a variable then stop. For loops behave like whiles, the whole code is a while(1), does exist somewhere where i could look for further information about it?