Hi all
So i am doing my uni assignment and I am struggling with my debugging. I need to stress that this is a uni assignment and not the real thing, so clearly some of it will not be of logical sense (more so to show that it works for what we need to do). Basically my code is done and is in a sequence that is correct. The problem i am having with debugging is stepping through the states. At the moment it will step into case 0 perfectly fine, goes down as correct and should go to the state = 1; line.
The problem after this is it does not go to the case 1, it jumps down to a random curly bracket line in case 3, jumps right down to the end of the code and repeats. Now my uni lecturer has told me that the problem is "You haven’t got a set of { } brackets encompassing all the code within each case:".
The code i have included is what i have without trying to incorporate his comments, but i have tried different approaches with said missing brackets and i am still getting the same result. I am using MPLAB X IDE v3.25 for my compiling if that matters.
Thanks
So i am doing my uni assignment and I am struggling with my debugging. I need to stress that this is a uni assignment and not the real thing, so clearly some of it will not be of logical sense (more so to show that it works for what we need to do). Basically my code is done and is in a sequence that is correct. The problem i am having with debugging is stepping through the states. At the moment it will step into case 0 perfectly fine, goes down as correct and should go to the state = 1; line.
The problem after this is it does not go to the case 1, it jumps down to a random curly bracket line in case 3, jumps right down to the end of the code and repeats. Now my uni lecturer has told me that the problem is "You haven’t got a set of { } brackets encompassing all the code within each case:".
The code i have included is what i have without trying to incorporate his comments, but i have tried different approaches with said missing brackets and i am still getting the same result. I am using MPLAB X IDE v3.25 for my compiling if that matters.
Thanks
Attachments
-
13.9 KB Views: 4