DIY Arduino Project: RPM Display for SC2 Lathe, SX2 Mill, and More

Sorry i did not get back sooner, the email notification wound up in my junkmail folder.

I just read thru my code it appears that the variable “PACKET_BITS_COUNT” may not be defined. This causes this one to fail “volatile uint8_t packet_bits[PACKET_BITS_COUNT];”

I would check to see if both the definitions below were somehow commented out. There should be two slashes “//” in front of only one definition like below.

// Uncomment for newer mill protocol
#define PACKET_BITS_COUNT PACKET_BITS+PACKET_BITS_HEADER
// Uncomment for old mill protocol
//#define PACKET_BITS_COUNT PACKET_BITS

That said, upon reading thru the code i do not see where “tpacket_ bits” is referenced again anywhere in the code. It may be that it is an artefact used for debugging that was left in.

If the above two lines are correct (only one commented out)try just commenting out the two lines below.

From:
volatile uint8_t packet_bits[PACKET_BITS_COUNT];
volatile uint8_t packet_bits_pos;

To:
//volatile uint8_t packet_bits[PACKET_BITS_COUNT];
//volatile uint8_t packet_bits_pos;

You are the first of the many people to implement this code to report an issue with this, so i suspect my first solution.

Please let me know if this solves your issue.

Jen