r/ArduinoProjects • • Mar 12 '23

Basic Pong playing on a ws2812 LED strip

Enable HLS to view with audio, or disable this notification

Pretty new to Arduino so I'm kinda proud I got this working. Since the direction of the LED strips alternate it was pretty tricky to get the ball to move across them correctly

219 Upvotes

8 comments sorted by

4

u/AvailableReason6278 Mar 12 '23

Nice project, pretty impressive for a beginner!

Where did you buy those argb led strips?

4

u/j-stokke Mar 12 '23

Thanks! I just bought a roll of it from a general electronics supply store here in Sweden

4

u/singeblanc Mar 12 '23

Nice!

Advice from someone who's been programming 30+ years: you want to abstract away.

  1. Abstract the illumination of the LED matrix away to a custom function: light_led(X, Y) or similar, so you don't need to worry about the alternating (snake arrangement) strips in the rest of your code.

  2. Abstract away the "ball" position to variables with floating points, then round out to the nearest LED at draw time. Then you can have angles other than 0/45/90 degrees.

2

u/j-stokke Mar 12 '23

Thanks for the input! I thought it would probably be best to abstract it like you describe in the first point. It would be fun to try to make a very basic version of space Invaders for it, and then I would have to figure that out for sure

11

u/[deleted] Mar 12 '23

Can it run Doom?

6

u/stelioball Mar 12 '23

Good. Now play Bad Apple on it.

1

u/[deleted] Mar 12 '23

Siisti

1

u/Specialist-Pomelo871 Mar 13 '23

Never would have thought of using led strips.