Glowing Heart
We calculate the final price from your selected file. You review and accept it before payment.
Saved on this device.
Model information
- Source
- Printables
- Category
- Other Art & Designs
- License
- Creative Commons — Attribution — Noncommercial
This was my first time combing Arduino with 3d printing. Eventually, I'll have a video for this project but not at the moment.
Here's the very basic code that I've programmed. (subject to change)
const int analogPin = A0;
const int redLED = 11;
const int whiteLED = 12;
const int threshold = 400;
const int OFF = 100;
void setup() {
pinMode(redLED, OUTPUT);
Serial.begin(9600);
}
void loop() {
int analogValue = analogRead(analogPin);
if (analogValue > 100 && analogValue < 300)
{
digitalWrite(redLED, HIGH);
digitalWrite(whiteLED, LOW);
}
else if (analogValue > 300 && analogValue < 500)
{
digitalWrite(redLED, LOW);
digitalWrite(whiteLED, HIGH);
}
else if (analogValue > 500 && analogValue < 800)
{
digitalWrite (redLED, HIGH);
digitalWrite (whiteLED, HIGH);
}
else
{
digitalWrite (redLED, LOW);
digitalWrite (whiteLED, LOW);
}