Hello,
I am quite new to coding for Arduino. I apologise that the subject headline might be confusing, I didn't know what else to call it.
In my project there is a small motor simulating a heartbeat. And this is the code:
[sub]int motorPin = 3;
void setup() {
pinMode(motorPin, OUTPUT);
}
void loop() {
digitalWrite(motorPin, HIGH);
delay(100);
digitalWrite(motorPin, LOW);
delay(300);
digitalWrite(motorPin, HIGH);
delay(100);
digitalWrite(motorPin, LOW);
delay(1200);
}[/sub]
What I would like to do is to have the 'heartbeat' change a little so it hopefully seems less mechanical. I think a possibility could be randomly choosing from an array of various 'heartbeats'.
But unfortunately I dont experience writing in C, so I would appreciate it very much if someone could help me