RobotCasserole1736 / RobotCasserole2022

RobotCasserole team 1736 Rapid React 2022 software
MIT License
4 stars 2 forks source link

Arduino/LED Intial Support #22

Closed gerth2 closed 2 years ago

gerth2 commented 2 years ago

We like pretty lights on our robot

These are usually run off of a separate processor called an Arduino. It's programmed in a different language than java - here's last year's for reference

Here's a tutorial on making an arduino control those LED's

Here's the code editor and toolchain for Arduino

We should have arduinos around programming area, see if you can find one.

I'm not sure what we have in terms of LED strips, but we'll need to get them hooked up to be powered from the test board and everything - poke a mentor for help if needed. Especially once we order them :)

Get some cool looking patterns put together. FOr now, we're just looking for nifty/pretty ideas. anything you come up with is fair game, ask a mentor if you're not sure how to make code to do a thing happen.

In a future activitiyl, we'll work on having multiple patterns available, and picking them from the roboRIO.

imdunne8 commented 2 years ago

Basic example for getting started with a button: https://www.instructables.com/Arduino-Button-with-no-resistor/

The outside two wires of the Vex button (white and black) are the ones that should be used, and it doesn't really matter if you reverse them

imdunne8 commented 2 years ago

https://howtomechatronics.com/tutorials/arduino/how-to-control-ws2812b-individually-addressable-leds-using-arduino/

Scroll to the code in the first example. You'll need to copy it into the Arduino IDE and modify NUM_LEDS and LED_PIN before loading it.

imdunne8 commented 2 years ago

Quite a few interesting pattern ideas (with code) here: https://www.tweaking4all.com/hardware/arduino/adruino-led-strip-effects/

imdunne8 commented 2 years ago

Implementing it in our 2022 code will look very similar to 2020. Controller Code Implementation in Robot.java