Since my last post I’ve improved the Arduino speedo code to respond to requests and also tweaked the gear ration to be a bit closer to my road bike. I’ve also implemented a simple speedo interface using Unity.
The Unity application also automatically searches the COM ports on the machine until it finds the Arduino speedo, it’s a bit hacky but works and means I don’t have to implement a COM port selection UI.
I’m going to add functionality to save off the readings to CSV log files too, at a later date I’ll add some kind of analysis in but getting the data saved is the important thing for now.
Update: CSV functionality has been added and I’ve tweaked the interface too.
For the Arduino portion of this weekend long hack, see here.
After a two week hiatus from work and blogging, spent mostly at the ever excellent Reading Beer Festival, I’m back at work and doing something so simple I’ve utterly forgotten how to do it. As this blog started as a way for me to keep track of random things I learn over the years, it’s time to write this one down.
Here’s the issue; I’ve created an XML file and want to create a C# class library to work with it in code. It’s really easy once you remember how, through the use of xsd.exe.
Create xml file
Run “xsd.exe filename.xml” to create an XSD file
Run “xsd.exe /classes /language:CS filename.xsd” to generate a .CS file
One thing that always makes me chuckle is this line that is included at the top of each CS file;
“This code was generated by a tool.”