Hi Richard,
According to Grace Rogers Cooper, in her classic work, Thirteen-Star Flags. She writes (p.24 & p. 49, Fig.19) and I paraphrase, hand zigzag stitching can be traced as early as 1850 but she says the earliest (that she found), machine zigzag stitching for stars was 1896 on the 45 star US flag which was adopted in 1896.