Jump to content

So I need help in my code for basic stamp.

 

Here is the layout:

- There are 10 LEDs (one bi-coloured) that are attached to the basic stamp board and a button off to the side.

- Each LED (not the bi-coloured) has to blink a certain amount of times. Before they start blinking, the bi-coloured LED has to be red.

- When the LEDs start blinking, the bi-coloured LED truns green. Once they stop, the bi-coloured truns red again.

 

That was figured out by me and I have it working.

- But the hard part which I cannot seem to figure out is:

- At the beginning only the bi-coloured LED is turned on. Once the button is pressed, the LEDs start to blink.

- But, if I press the button again, ALL LEDs turn off (except with the bi-coloured LED which turns back to red).

- And if I press the button again, the LEDs should start over.

 

 

The best I could do was once I press and hold the button, the LEDs turn off, but once I release it, it starts where it left off.

 

The raw code: http://pastebin.com/L5LnhK0Y

 

The code for the best I could do: http://pastebin.com/dPD7vcC8

 

 

I'd like to also point out that there is not actual way for me to test this code because the board isn't with me and can only test it on the 4th when I return to school.

 

My Current Build:

CPU: Intel Core i5 4690K @ 4.5 GHz MOBO: ASUS Z97M mATX RAM: Samsung 8GB (2 x 4 GB) @ 1600 MHz Storage #1: Seagate Barracuda 1 TB HDD Storage #2: Kingston SSDNow V300 Series 120 GB SSD GPU: Gigabyte Radeon R9 280X WINDFORCE Case: Cooler Master N200 PSU: EVGA 80+ Bronze 600B 600W Monitor: AOC 2367 23" IPS Display 

Future Upgrades
RAM: Samsung 8GB (2 x 4 GB) @ 1600 MHz (for a total of 16 GB) Storage #3: Sansung 850 Pro Series 256 GB SSD GPU: MSI GeForce GTX 970 Twin Frozer V Case: Corsair 350D Window mATX PSU: Cooler Master VSM 80+ Gold  650W
Add me on Steam:
Click me!
Link to comment
https://linustechtips.com/topic/518129-basic-stamp-25-help/
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×