Tachometer with Hall effect sensor
Автор: Arduino-Gimmicks
Загружено: 2020-06-22
Просмотров: 18164
Описание:
A tachometer (or even speedometer) can easily be build using an arduino nano and a hall effect sensor.
The hall effect sensor I use is a no latching on (US5881) which emits a signal each time the north pole of a magnet passes.
volatile unsigned int count = 0;
unsigned long next = 5000;
unsigned int temp = 0;
void setup()
{
Serial.begin(115200);
attachInterrupt(digitalPinToInterrupt(2), magnet_detect, RISING);
}
void loop()
{
if (millis() > next) {
temp = count;
Serial.println(temp*12);
count -= temp;
next += 5000;
}
}
void magnet_detect()
{
count++;
}
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: