Click the icons below:
Purpose:
The purpose of this project was to introduce us to interrupts in the Arduino environment. Using interrupts in the future will provide us with more accurate code and will allow us to create and run more complex sketchs.
Procedure:
We used the code from last week but implemented everything needed for interrupts and the rpm equation. The rpm equation is (rpm = 30000/(millis() - timeold)*rpmcount;) 30000 is the base line for the rpm. There are 60 seconds in a minute and 1000 milliseconds in a second. We then devide 60000 by two because the fan sends a signal every half rotation. (millis() - timeold) is the amount of time it took to do one full rotation. In other words it is simply (total time - the last time recorded). rpmcount un we multiply it by rpmcount because in the sketch we only display it when rpmcount is 100. If we didn't multiply it by rpmcount o we would be returning one hundred rotations per minute.
No comments:
Post a Comment