1 / 3
Glowing Heart — image 1
1 / 3

Glowing Heart

Order a print of this model

We calculate the final price from your selected file. You review and accept it before payment.

Saved on this device.

Model information

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);
 }

Tags