11-09-2024 03:41 AM
I'm currently stuck trying to make a color box blink red at a 10hz frequency and I'm not really sure how to fix my code to work with it. I currently have a while loop with a shift register setup with a case structure inside that outputs red (255,0,0) when true and black (0,0,0) when false. Problem I'm having is I can't seen to get the boolean value to change between true/false in the shift register to do this.
11-09-2024 09:38 AM
Well, you forgot to attach your code! So, nobody can see your loop, your Shift Register, yor control terminal, your logic or your timing.
However, I am certain that at least one of those is the cause of your problem.
11-09-2024 11:14 AM - edited 11-09-2024 11:43 AM
@ignoic wrote:
I'm currently stuck trying to make a color box blink red at a 10hz frequency and I'm not really sure how to fix my code to work with it. I currently have a while loop with a shift register setup with a case structure inside that outputs red (255,0,0) when true and black (0,0,0) when false. Problem I'm having is I can't seen to get the boolean value to change between true/false in the shift register to do this.
Obviously, you made a mistake, but given the sparse information, there are millions of ways that could explain your symptoms.
To select between exactly two possibilities, a "select" would seem much more appropriate compared to a case structure.
If your colorbox only has exactly two states ever, why not use a square boolean with the true an false colors defined as needed.
Please show us your code as already requested so we can narrow down the possibilities.
Are you sure you are wired to the output of the shift register and not to a tunnel underneath it? What is supposed to change your boolean (a NOT operation, perhaps? Something else?). What keeps the loop running? How do you define the loop rate? Is the color terminal inside or outside the loop?
I also recommend the learning resources listed at the top of the forum.
11-09-2024 11:24 AM