Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

Ant+ tachometer for Android

Rank

Total Posts: 7

Joined 2013-10-14

PM

Hello

I have to program a tachometer for Android. Therefore I downloaded the Ant+ SDK with the Ant+ Plugin Sampler. I’m using the Activity_BikeSpeedDistance.java, the Activity_Dashboard.java and the related layouts.

Are the following points correct?
- Calculated speed is measured in m/s
- calculatedAccumulatedDistance is the distance in meter
- TimestampOfTheLastEvent shows the time since the first connection in seconds


Where is the wheel circumference to be set? In the receiving app for calculating or is it already calculated before transmitting?
And I have another question about something else: Is it possible to send an Ant+ Bike Speed Protocol with a microcontroller and an Ant transmitter? I have to find out if it’s possible, so that someone else could realize it in the next project.

Thanks in advance smile

Edit: Deleted solved problems.
     
Rank

Total Posts: 7

Joined 2013-10-14

PM

For testing I use the Ant+ USB Stick of the Tacx Bushido and the Ant+ Sensor Simulator.

And I just noticed, that it only crashes by transmitting Bike Speed. When I'm transmitting Bike Speed & Cadence, it runs more than 2 minutes, then i stopped.      
Rank

Total Posts: 7

Joined 2013-10-14

PM

I already solved some problems. But I still have problems with setting the time in hh:mm:ss and by calculating the average speed.
For the time format i used the following code: (in method onNewRawSpeedAndDistanceData)
try
{
BigDecimal hours = new BigDecimal("3600");
BigDecimal minutes = new BigDecimal("60");
hours = timestampOfLastEvent.divide(hours).setScale(0);
minutes = timestampOfLastEvent.divide(minutes).setScale(0);
BigDecimal seconds = timestampOfLastEvent.remainder(minutes).setScale(0, RoundingMode.DOWN);
tv_time.setText(String.valueOf(hours)+":"+String.valueOf(minutes)+":"+String.valueOf(seconds);
}
catch (Exception e)
{
//
}

But it doesn't work and don't know why. Is there anybody who already did this calculation or got a solution for it?