From b8d357ee7765e5c22945aa56312b91264357e058 Mon Sep 17 00:00:00 2001 From: Jeffery R Date: Sat, 17 Mar 2018 08:49:38 -0400 Subject: [PATCH] Fixed the definition of resolution in Arduino file to prevent naming collisions with timer1 --- entries/projects/musical-floppy-drive-build-log.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/entries/projects/musical-floppy-drive-build-log.md b/entries/projects/musical-floppy-drive-build-log.md index 97b10ef..5dc6f57 100644 --- a/entries/projects/musical-floppy-drive-build-log.md +++ b/entries/projects/musical-floppy-drive-build-log.md @@ -149,6 +149,7 @@ Open up your Arduino software and paste the following code in the editor: ``` #include +#define RESOLUTION1 40 boolean firstRun = true; // Used for one-run-only stuffs; @@ -182,8 +183,8 @@ int currentState[] = { 0,0,LOW,LOW,LOW,LOW,LOW,LOW,LOW,LOW,LOW,LOW,LOW,LOW,LOW,LOW,LOW,LOW }; -//Current period assigned to each pin. 0 = off. Each period is of the length specified by the RESOLUTION -//variable above. i.e. A period of 10 is (RESOLUTION x 10) microseconds long. +//Current period assigned to each pin. 0 = off. Each period is of the length specified by the RESOLUTION1 +//variable above. i.e. A period of 10 is (RESOLUTION1 x 10) microseconds long. unsigned int currentPeriod[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; @@ -215,7 +216,7 @@ void setup(){ pinMode(16, OUTPUT); // Step control 8 pinMode(17, OUTPUT); // Direction 8 - Timer1.initialize(RESOLUTION); // Set up a timer at the defined resolution + Timer1.initialize(RESOLUTION1); // Set up a timer at the defined resolution Timer1.attachInterrupt(tick); // Attach the tick function Serial.begin(9600);