Skip to content

eadf/esp8266_tachometer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

esp8266_tachometer

A simple tachometer implementation. This used to be a sub-module in another project.

It works by setting up a periodic timer and an interrupt. The interrupt increases a counter each time the GPIO alters state. The timer calculates the number of alternations over time and presents the frequency [Hz] to the 'clients'.

###Public API

Setup the GPIO,interrupt and timer:

void tachometer_init(uint8_t ioPin);

Returns the frequency from the last timer period:

uint32_t tachometer_getSample(void);

###Example

See esp8266_digoleserial demo.

###Todo

  • remove hardcoded timer period
  • Implementation uses global static data so there can only be on call to tachometer_init()

About

A simple tachometer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published