Hi, I am new to Arduinuo and know nothing (yet) about creating sketches etc. I have downloaded tacho.txt, changed the file to .ino and, from the library, downloaded liquid crystal _PCF8574. When I verify the sketch I receive the message "stray '\357' in program". Can someone please tell me what this means and what needs doing to correct the error.
Many thanks,
Fred.
Many thanks,
Fred.
You have a bad character (non ASCII) in the source file, whose octal code is 357 (ie 11101111 binary)
You have to find and delete it.
You have to find and delete it.
Mark, thank you for taking the time to reply. I have looked through the sketch but nowhere can I see either 357 or 11101111 binary. Is there something else I should be looking for?
No, you don't understand, the character _code_ is 11101111, you need a decent programmer's editor that flags up non-ASCII characters. A lot of WYSIWYG editors are hopeless at this.
You are quite correct, Mark - I don’t understand at all !! I’m afraid doing anything with programme editing is way beyond me. Nevertheless, thanks again for trying to help.
Fred.
Fred.
Binary 11101111 is 239 decimal; look for a "union" character (∩) in the text.
One other possibility: Check that line #25 is written exactly as below:
byte DISC[8]={B00000,B01110,B11111,B11011,B11111,B01110,B00000,B00000}; //* LCD custom char
If you copied the sketch from a code window here on DIYAudio, it randomly omits characters. You should always copy the sketch as the attached .txt file.
One other possibility: Check that line #25 is written exactly as below:
byte DISC[8]={B00000,B01110,B11111,B11011,B11111,B01110,B00000,B00000}; //* LCD custom char
If you copied the sketch from a code window here on DIYAudio, it randomly omits characters. You should always copy the sketch as the attached .txt file.
Mark, I don't have/use any text editor at all. In fact I really wouldn't know what to do with one!!
Bill (?) thank you for contributing. I have looked through the Tach.ino code I downloaded and cannot see a union character anywhere in the text. Also I have checked the code you mention on line #25 and the code appears exactly as you have written. The sketch I copied was from post #315, not from a code window. Not sure, therefore, what has gone wrong.
Bill (?) thank you for contributing. I have looked through the Tach.ino code I downloaded and cannot see a union character anywhere in the text. Also I have checked the code you mention on line #25 and the code appears exactly as you have written. The sketch I copied was from post #315, not from a code window. Not sure, therefore, what has gone wrong.
Compile error
I think I'm using the latest sketch but I get the following compile error, but am not sure what to change. Maybe I have the incorrect "LiquidCrystal_PCF8574" library?
error:
Arduino: 1.8.9 (Windows Store 1.8.21.0) (Windows 10), Board: "Arduino/Genuino Uno"
C:\Users\whirs\Documents\Arduino\Tach_Jan_8_2019\Tach_Jan_8_2019.ino: In function 'void setup()':
Tach_Jan_8_2019:47:24: error: no matching function for call to 'LiquidCrystal_PCF8574::createChar(int, byte [8])'
lcd.createChar(0,DISC);
^
In file included from C:\Users\whirs\Documents\Arduino\Tach_Jan_8_2019\Tach_Jan_8_2019.ino:1:0:
C:\Users\whirs\Documents\Arduino\libraries\LiquidCrystal_PCF8574-1.2.0\src/LiquidCrystal_PCF8574.h:60:8: note: candidate: void LiquidCrystal_PCF8574::createChar(int, int*)
void createChar(int, int[]);
^
C:\Users\whirs\Documents\Arduino\libraries\LiquidCrystal_PCF8574-1.2.0\src/LiquidCrystal_PCF8574.h:60:8: note: no known conversion for argument 2 from 'byte [8] {aka unsigned char [8]}' to 'int*'
exit status 1
no matching function for call to 'LiquidCrystal_PCF8574::createChar(int, byte [8])'
I think I'm using the latest sketch but I get the following compile error, but am not sure what to change. Maybe I have the incorrect "LiquidCrystal_PCF8574" library?
error:
Arduino: 1.8.9 (Windows Store 1.8.21.0) (Windows 10), Board: "Arduino/Genuino Uno"
C:\Users\whirs\Documents\Arduino\Tach_Jan_8_2019\Tach_Jan_8_2019.ino: In function 'void setup()':
Tach_Jan_8_2019:47:24: error: no matching function for call to 'LiquidCrystal_PCF8574::createChar(int, byte [8])'
lcd.createChar(0,DISC);
^
In file included from C:\Users\whirs\Documents\Arduino\Tach_Jan_8_2019\Tach_Jan_8_2019.ino:1:0:
C:\Users\whirs\Documents\Arduino\libraries\LiquidCrystal_PCF8574-1.2.0\src/LiquidCrystal_PCF8574.h:60:8: note: candidate: void LiquidCrystal_PCF8574::createChar(int, int*)
void createChar(int, int[]);
^
C:\Users\whirs\Documents\Arduino\libraries\LiquidCrystal_PCF8574-1.2.0\src/LiquidCrystal_PCF8574.h:60:8: note: no known conversion for argument 2 from 'byte [8] {aka unsigned char [8]}' to 'int*'
exit status 1
no matching function for call to 'LiquidCrystal_PCF8574::createChar(int, byte [8])'
It would appear that I needed to use the previous release of the library. I made that change and now I'm at least getting the correct text on the screen
I think I'm using the latest sketch but I get the following compile error, but am not sure what to change. Maybe I have the incorrect "LiquidCrystal_PCF8574" library?
error:
Arduino: 1.8.9 (Windows Store 1.8.21.0) (Windows 10), Board: "Arduino/Genuino Uno"
C:\Users\whirs\Documents\Arduino\Tach_Jan_8_2019\Tach_Jan_8_2019.ino: In function 'void setup()':
Tach_Jan_8_2019:47:24: error: no matching function for call to 'LiquidCrystal_PCF8574::createChar(int, byte [8])'
lcd.createChar(0,DISC);
^
In file included from C:\Users\whirs\Documents\Arduino\Tach_Jan_8_2019\Tach_Jan_8_2019.ino:1:0:
C:\Users\whirs\Documents\Arduino\libraries\LiquidCrystal_PCF8574-1.2.0\src/LiquidCrystal_PCF8574.h:60:8: note: candidate: void LiquidCrystal_PCF8574::createChar(int, int*)
void createChar(int, int[]);
^
C:\Users\whirs\Documents\Arduino\libraries\LiquidCrystal_PCF8574-1.2.0\src/LiquidCrystal_PCF8574.h:60:8: note: no known conversion for argument 2 from 'byte [8] {aka unsigned char [8]}' to 'int*'
exit status 1
no matching function for call to 'LiquidCrystal_PCF8574::createChar(int, byte [8])'
RTC
It is already quite accurate but I must still ask the question, would an RTC increase the precision of this tachometer?
This is my OLED version
This LP12 was actually running to fast, now adjusted.
DIY LP Turntable tachometer |
It is already quite accurate but I must still ask the question, would an RTC increase the precision of this tachometer?
This is my OLED version

This LP12 was actually running to fast, now adjusted.
DIY LP Turntable tachometer |
By 'RTC' do you mean Real Time Clock?
The accuracy is affected by the actual operating frequency of the crystal on the Arduino board. It is not adjustable, thus the CALIBRATE variable in the sketch that should be set to the frequency at output digital2 x 120. It may be prone to drift with temp, but as the room temp probably doesn't vary much, it should be negligible.
The accuracy is affected by the actual operating frequency of the crystal on the Arduino board. It is not adjustable, thus the CALIBRATE variable in the sketch that should be set to the frequency at output digital2 x 120. It may be prone to drift with temp, but as the room temp probably doesn't vary much, it should be negligible.
Tnx, That makes life a bit easier 😉By 'RTC' do you mean Real Time Clock?
The accuracy is affected by the actual operating frequency of the crystal on the Arduino board. It is not adjustable, thus the CALIBRATE variable in the sketch that should be set to the frequency at output digital2 x 120. It may be prone to drift with temp, but as the room temp probably doesn't vary much, it should be negligible.
This project was fun I went for a slight modification to be able to use an OLED
The graphics has been simplified to only show value or dashes depending on run status. I have made a writeup that is easy to follow (I hope!) so that most people can land the project. With a Arduino Nano and an 128x32 OLED the unit can be housed inside a matchbox sized housing.
Sketch and hook up schematics can be found here ->
DIY LP Turntable tachometer |
/Stefan
The graphics has been simplified to only show value or dashes depending on run status. I have made a writeup that is easy to follow (I hope!) so that most people can land the project. With a Arduino Nano and an 128x32 OLED the unit can be housed inside a matchbox sized housing.
Sketch and hook up schematics can be found here ->
DIY LP Turntable tachometer |
/Stefan
I notice the sketch is all mangled up on that page with missing newlines and # characters by the look of it.
Yes I removed some functions that I found no need for.
The code view I posted might be a bitt different to the actual code depending of how the web browser reads it.
There is a zip download for the actual Arduino sketch and that one .
However their might be changed in the near future as I still are tampering with it 😉
The code view I posted might be a bitt different to the actual code depending of how the web browser reads it.
There is a zip download for the actual Arduino sketch and that one .
However their might be changed in the near future as I still are tampering with it 😉
Last edited:
Yes I removed some functions that I found no need for.
The code view I posted might be a bitt different to the actual code depending of how the web browser reads it.
There is a zip download for the actual Arduino sketch and that one .
However their might be changed in the near future as I still are tampering with it 😉
Webpage updated for better code view 😉
That X my mind but would increase the price of the project to an unhealthy levelAnother option is to replace the onboard 16Mhz crystal with a TCXO/OCXO.

Some progress to get this thing tiny, need to get a 3D printer now 😀
RPM figures on the screen is just the speed of my hand passing twice....
DIY LP Turntable tachometer |

RPM figures on the screen is just the speed of my hand passing twice....

DIY LP Turntable tachometer |
Last edited:
- Home
- Source & Line
- Analogue Source
- Digital Tachometer for record player (LCD display)