webOS Nation Forums
> Homebrew
> webOS homebrew apps
>
Carpenter's Level
1
2 3
Member:
kmax12
at: 11:07 PM 07/24/2009
This is a spirit level or carpenter's level that uses the accelerometer to determine the orientation. I don't find it to be very accurate, but its a fun tool to have. In the code I adjust for how the Pre doesn't sit quite straight. In my Pre this allows it to just about zero out accurately. From my testing it is accurate withing +/-.2 degrees.
As you will see, the graphics are atrocious. This app can't reach its potential without killer graphics. I, unfortunately, can't make them so it is up to you guys.
Usage info
- have slider closed
- place pre battery side down
- app takes a couple seconds to zero in on the correct angle (there maybe be some jumping around)
- remember this is an app in progress and in beta testing stages
- card must be maximized otherwise it will pause (for battery reasons)
Well, that is it download below and leave feedback
Download the latest version from the
Homebrew Apps Gallery:
Carpenter's Level
Going to try this out...was waiting for an app like this to come along! Thanks!
Member:
daba
at: 11:16 PM 07/24/2009
kmax12
Love ur apps keep up the good work. Reading and studying to someday release my own apps. Thanks
Well, works as documented...wish it was faster...oh well. Works in a pinch!
Member:
dcoaster
at: 11:23 PM 07/24/2009
I guess this is the only time I would wish the Pre had some flat edges!
cool! of course with all the curves, leveling is difficult with the Pre. still neat, though.
Looks like some code optimizing is needed, the updates are very slow. I'm sure the hardware on the Pre is robust enough to smooth out the movement.
Keep up the good work!
Member:
jhoff80
at: 11:34 PM 07/24/2009
Originally Posted by sweet greggo:
cool! of course with all the curves, leveling is difficult with the Pre. still neat, though.
Looks like some code optimizing is needed, the updates are very slow. I'm sure the hardware on the Pre is robust enough to smooth out the movement.
Keep up the good work!
Part of that is limited number of updates for the accelerometer too.
Member:
kmax12
at: 11:36 PM 07/24/2009
Originally Posted by sweet greggo:
cool! of course with all the curves, leveling is difficult with the Pre. still neat, though.
Looks like some code optimizing is needed, the updates are very slow. I'm sure the hardware on the Pre is robust enough to smooth out the movement.
Keep up the good work!
actually the sdk only allows getting info from the accelerometer 4 times a second, I think I read somewhere that the iphone is 20 (maybe it was 40). Unless this is changed, it is going to be jerky. However, I am gonna try to smooth the bubble movement by animating the in between frames so it at least gives the appearance of smoothness.
Member:
Felipe
at: 01:05 AM 07/25/2009
hey, there is an app for that.
Member:
oaponte
at: 01:57 AM 07/25/2009
great concept!!
Member:
uphat
at: 02:46 AM 07/25/2009
Just the app I need to balance my pre on it side
Excellent idea. You should continue working on this app.

Originally Posted by kmax12:
actually the sdk only allows getting info from the accelerometer 4 times a second, I think I read somewhere that the iphone is 20 (maybe it was 40). Unless this is changed, it is going to be jerky. However, I am gonna try to smooth the bubble movement by animating the in between frames so it at least gives the appearance of smoothness.
is that something that can be changed or is it stuck at 4 a second?
Member:
JWille
at: 03:36 AM 07/25/2009
Haven't tried it yet but already got a request

. I always thought it would be cool to have an adjusted zero button. That way I could use it in any orientation or to replicate different readings. Thanks! Hope you continue the app!
Member:
jhoff80
at: 04:54 AM 07/25/2009
Originally Posted by mrloserpunk:
is that something that can be changed or is it stuck at 4 a second?
It's the max Palm allows at the moment, so it's stuck.
could this be adapted to measure G-forces in a car? you know... for on-track use?
Member:
boxboy
at: 06:28 AM 07/25/2009
I hope Palm increases the update refresh rate!
Member:
kmax12
at: 09:41 AM 07/25/2009
Originally Posted by clerick44:
could this be adapted to measure G-forces in a car? you know... for on-track use? 
there is api's on plams website for G forces so it is possible. how would this be incooperated? is it just a numerical output or are there asociated graphics?
also would you only need one axis or all 3?
Originally Posted by kmax12:
there is api's on plams website for G forces so it is possible. how would this be incooperated? is it just a numerical output or are there asociated graphics?
also would you only need one axis or all 3?
I would imagine a simple X/Y plot marked from 3 to -3 in .2g intervals on the Y axis and, -1.2 to 1.2 in .05g increments for the X axis. Y would represent the acceleration/braking and the X would be lateral G's. There would be a dot floating around that plots with parameters at the same time and an Actual read out that would show instantaneous and max values in each of the four directions.
AND if the programming gods smiled bright on me it would have the ability to measure and/or graph speed versus time.
Am I being greedy?
Originally Posted by kmax12:
actually the sdk only allows getting info from the accelerometer 4 times a second, I think I read somewhere that the iphone is 20 (maybe it was 40). Unless this is changed, it is going to be jerky. However, I am gonna try to smooth the bubble movement by animating the in between frames so it at least gives the appearance of smoothness.
Surely that will be increased. The accelerometer needs to be updated quicker not only to make apps like this more useful, but for gaming. I know Palm said this isn't a high end gaming device, but ultimately the end user will decide that.
1
2 3
webOS Nation Forums
> Homebrew
> webOS homebrew apps
>
Carpenter's Level