A long while back now I bought a DeskCycle to use at work to help my body stay more active whilst at my desk, standing desks aren’t an option so this seemed ideal.  I’m also a massive geek, which is a massive surprise I know, so I built a PC interface for it using an Arduino and a desktop display using a Unity application.  I’ve been using this for the last year and a half according to the CSV logs.

The DeskCycle has developed a squeel at certain speeds so I though I’d throw a tweet towards the manufacturers to ask how to oil it and to quote my distance too, I used a simple powershell script to get a CSV of the total distance for each day then threw it into Excel.

deskcycle-distance

As of about half an hour ago I’ve cycled a virtual 3159 miles at an average 9.46MPH.  Damn I need to add an odometer to my display!

The powershell script is as follows for those interested, it gets a list of all CSVs, gets the last line from each and spits it out into a new file. Very handy!

$alldata = "DateTime,Speed (MPH),Cadence (RPM),Distance (Miles),Duration (HH:MM:SS)`r`n"
Get-ChildItem -Filter *.csv | 
Foreach-Object {
 $content = Get-Content $_.FullName -tail 1
 $alldata += $content + "`r`n"
}
$alldata | Out-File alldata.csv

 

Leave a Reply

%d bloggers like this: