Stap 4: Upload de Code
Open de Spark Core online IED, kopieer de onderstaande code in de IED en flash van de kern.
#define led 7<br>Servo servo; //Create Servo object void setup() { pinMode(7,OUTPUT); servo.attach(0); //Attach Servo to Pin 0 } void loop() { if (Time.year() == Insert Next Year) { //Check if it is the next year digitalWrite(led,HIGH); servo.write(170); //If it was true drop the ball delay(1000); servo.detach(); } else{ digitalWrite(led,LOW); //If not correct year make sure the led is off } }