I have been working on a class to take care of all my input output directly to the screen buffer on a ppc. I think I have got it working but I do not have any vga device to test on. I have normal orientation screens (most ppc) and one landscape (natively I mean) in my ipaq. There is some complication in the addressing of rotated screens. I would like to know if my drawing turnes out ok on other devices.
If you are willing to give mytest app a go, here is the link
http://odeean.veritel.com.au/demo buffer user/ORD_Screen_Draw.exe
disclaimer:
The program is supposed to let you draw a series of randomly sized and coloured rectangles on the screen. It clips these so they fit into the buffer for the screen. On all of my devices this works perfectly, but during development it caused many hard resets. If there is a bug that you pick up it could cause anything from nothing at all to needing a hard rest.
the program also can save a screen image at an interval of up to 1 minute. I also would like to know if this works on other devices and resoltions properly. Because this is for testing only, the output is marked so it is not much use for anything. This is to stop people from wanting to use this as a screen saver who have not really understood the potential harm a buffer over run could cause.
It should also work in portrait mode with no difference.
18 bit screens are not supported.(this means atom)
OK, tried it on iPaq 1950 (WM5) – no bugs.
On LOOX 720 (WM 2003SE VGA) – random fill and fragment are quarter screen everything else works fine. No hard resets so far.
Thank you levenum.
I think the fill is wrong because I binary shifted the random numbers to limit their size. Do the random rects seem to get clipped to a common edge thats 1/4, or do they just not go further over time.
I will post another version tomorrow night with adjustments. I am just glad it didn't crash.
The thing that bugs me is that they call the pointer a pointer to the hardware. It can't be because when I try to screen save from my onboard camera it will not save the image, only the icons on screen. I am going to test a plug in camera tomorrow.
OdeeanRDeathshead: do you know if they use overlays on the PPC? I've played with a few apps that seem to exhibit odd characteristics when being manipulated externally/screen grabbed etc; I didn't go further, but it seemed a plausible explanation.
V
I cant give a definite answer. I know that the actual camera data MUST be stored somewhere off the buffer because it is simply too big. If the res is greater than 240 by 320 (and it is) then the camera image must go to a holding area for processing down to a preview for the screen. I tried setting my res to lowest and to bitmap but it did not help.
I am no expert in this, I understand the principle of combining two images for performance but I always thought that the pointer we got was to the hardware. Meaning that the pointer addressed some memory that was hard wired into the pixels. This must be incorrect. If it was the real memory that controlled the pixels then there would be no way to not get the image when saving their state. We must get one of a number of buffers that get combined into the real pixel area.
I know that the memory we do get is definately on the ram allong with everything else. I tested writing over the buffer to gradually increasing degrees. After a certain offset I think I wrote over windows because the device locked up and hard reset by itself.
I think that the camera would write to a fixed location on the ram. Given this it would be possible to search manually until finding the correct spot. It would just take a long time, and my code would need to be re-written to display the maximum res of my camera otherwise I would never know when i found it. Doing it this way would be a hack and not useful for the future
At least I can grab the screen from my plug in camera....
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
My pretec camera will not install on my ipaq. In fact not only dose it not install, it forces a hard reset. That software (PPC2002_ENG.exe) from pretec is the most dangerous I have ever found. I get some error about filesys then no more :x
At least it works on my toshiba (shown above).
The new version is now in the location linked above. It should draw the rects over more of the screen in vga devices. As I don't have a vga, if it fails I will wait until later this year when I get my exec before fixing for vga.
Hi OdeeanRDeathshead!
Tried the new version on the LOOX (just to get a short break from tedious project 8) ), it works full screen, but jams the device at random intervals. Fragment works three-four times in a row, but random wont even finish the first time.
Fortunately though after playing with it for 5 times (yes the current project is driving me nuts :shock: ) there was no need to HR the device.
My guess is you exceeded the buffer but not enough to cause permanent damage.
Thanks again for the help. I will not try to get it working on vga any more until I buy one.
I have been experimenting with the memory surrounding the screen buffer in hope of finding the space the camera uses. I have noticed something that must be more than coincidence. I modified my code to display the contents of memory at increasing intervals from the screen buffer. I can read up to 32 blocks (including the visible screen) but then it fails. I do not know why it fails because the distance from the starting point is only bytesperpixel*ydimension*xdimension*31 ie 2*240*320*31=4761600 bytes.
Screen capture is possible when a picture has been takeen. This shot was captured after the camera button was pressed. I could simulate a button push, then grab the screen image.
Whats your project?
A content program.
Speaking of which, did you ever mess around with RichInk control?
I am trying to implement a simple text search in it. I find the text, select it (those are easy) but I can't scroll the text in to view.
I tried EM_SCROLLCARET and EM_LINEFROMCHAR but they just return 0, and according to MSDN the control does not support any messages that could be used for this purpose.
If you have any ideas they would be greatly appreciated.
Thanks in advance, and good luck with your new device!
(Its fun getting new toys isn't it )
Ok, did you have it NOT in VT_DRAWINGVIEW when you selected the text. And if you cant see it are you sure you selected it. Have you tried using EM_SCROLL or EM_LINESCROLL or even WM_VSCROLL. If they worked you would need to keep track of the position.
I have not used the richink before. The documentation as you said, is lacking scroll messages. Maybe another example of the unfinished api syndrome.
I tried to broadcast a WM_LBUTTONDOWN followed by WM_LBUTTONUP to simulate button taps to my camera. The code works on ppc2002 but on wm2003 it just flickers the button for a split second then dose nothing. Is there some change in how broadcasts work for newer os?
dose anyone know why this code starts notes even though the registry says the value (0x40c3) is for camera?
PostMessage(HWND_BROADCAST, WM_HOTKEY, 0x40c3,NULL);
I figured out the simulated screen taps..
mouse_event(MOUSEEVENTF_LEFTDOWN|MOUSEEVENTF_ABSOLUTE,61439,1638,0,NULL); mouse_event(MOUSEEVENTF_LEFTUP|MOUSEEVENTF_ABSOLUTE,61439,1638,0,NULL);
That hits the ok/X button for 240/320 res screens.
Still need help with the hardware buttons.
<<<<<<edit>>>>>>
Forget the hardware buttons. I have tried sending messages directly using the window handles for various programs with mapped buttons and they just don't respond. I have played with combinations of other parameters and numbers. The only one ever responding is notes.
this works much better, if:
1) you are trying to dump the screen of the xda II mini camera
2) in the camera settings you have it set to preview after taking a shot
3) the code is executed from a thread that dose not have a message loop.
The camera will not start if another program dose not respont to the os.
//this for launching camera
PROCESS_INFORMATION pi;
::CreateProcess(_T("\\windows\\camera.exe"),
NULL,
NULL,
NULL,
FALSE,
0,
NULL,
NULL,
NULL,
&pi);
Sleep(thisObject->waitThislongBeforeSave);
// Send keypresses that mean enter, camera will take shots when return is pressed
keybd_event(VK_RETURN,0,KEYEVENTF_SILENT,0);
keybd_event(VK_RETURN,0,(KEYEVENTF_KEYUP|KEYEVENTF_SILENT),0);
Sleep(5000);
//this is when I dump the screen
thisObject->_SCREEN_SAVE_();
// Send keypresses that mean enter
keybd_event(VK_RETURN,0,KEYEVENTF_SILENT,0);
keybd_event(VK_RETURN,0,(KEYEVENTF_KEYUP|KEYEVENTF_SILENT),0);
Sleep(2000);
//close the camera
mouse_event(MOUSEEVENTF_LEFTDOWN|MOUSEEVENTF_ABSOLUTE,61439,1638,0,NULL);
mouse_event(MOUSEEVENTF_LEFTUP|MOUSEEVENTF_ABSOLUTE,61439,1638,0,NULL);
I gave generous sleeps to give the camera time to do its thing.
Related
I have never used gapi, I was looking for a solution to a problem. When you have used GXOpenDisplay to take over the screen dose this mean that what other programs/os write to the screen will no longer happen until you give up controll of the screen? Or dose it just mean that you have power to write anywhere and if new data gets written you just write over it again?
I also see that GXOpenDisplay need a handle of a window to be full screen mode. What I want to do is read in whats on the screen so if I make a full screen window it would defeat the purpose. Can it work with an invisible full screen window so that I can provide a valid hwnd of the top full screen window but still actually see the next window. I have no need for writing to the buffer only reading from it.
MS recomends get rid of GAPI and use frame buffer access
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnppcgen/html/dpi_awareness.asp
(100% for VGA devices)
Thankyou very much ku3vw. That looks more usefull. I have not started yet so this will lead me in a different direction. Sometimes it pays to ask
I just finished testing the ExtEscape way and it works well for my newer devices. I didn't try and read yet but I did manage to draw a few lines at various locations and colour on my screen. No window needed!
The big problem is that this is not impemented by the oem's on any of my older devices. Part of the purpose was to grab some images from a cammera card that plugs into an old ipaq expantion jacket. Still this was a help.
Out of curiosity dose anyone know if there is some logical order for the progression of colours from 0-65535. RGB() works properly with the buffer but I was playing arround with straight numbers to see if there is any pattern. eg 255 is white but 65535 is the same white, and even small increments can result in vastly different colours.
There is a lot of bad stuff this writing to the screen could be used for. It surprizes me that it is this easy. There is realy no give away that the image that results was generated not by a window, eg no flicker.
OdeeanRDeathshead: I've never done any GAPI work, so can't help on your immediate issue, but offtopic, I had a possible idea about how to get better screen captures - read of my woes here.
Now this is possibly all poo, and forgive my ignorance because I have never used it, but I understand that using GAPI, it's possible to get the memory address for the screen buffer in a painless fashion. So, one starts GAPI, gets the screen buffer address, and then closes GAPI. Now, I don't know if that address is the same as the normal non GAPI screen buffer, but one way or the other, we get the screen buffer address, okee dokee..
Next step, create the equivalent of a memory mapped file in the space of the screen buffer.
Next, write a background app, interrupt or timer driven, to continuously append the contents of the memory mapped file to a file saved in local storage. Thus, we should have a continous dump of the screen buffer - ie continuous screen capture. The file needn't append, it can overwrite the locally stored file, and use it for streaming...
Subject to storage speeds, we can store this "file" on a network drive, eg through USB or WIFI, or otherwise access the file remotely. In this manner, we can then stream the PDA's screen buffer (in)directly to a non local device, permitting us to have relatively high speed remote displays eg for powerpoint presentations etc.
Now, again, I have no idea if any of this is possible, but I know that most apps currently just continuously screen grab, create a compatible bitmap and then save the bitmap. However, if we directly stream the screen buffer, there's no processing required by the local device (the PDA), and the remote device (a PC?) can translate the buffer into a displayable image using its own CPU.
However, this might all be the gibberings of an in-experienced coder. Wibble.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
V
You are getting a bit more complex than I had in mind. The "other end" for me is another pocket pc. Because of the cost of data transmition I do not want to stream the data to reproduce video on the other side. Instead my monitoring app will ask the user some questions regarding the environment and then on a regular basis (say once every 30 seconds) perform a comparison between the new image and an older one stored in file. If it determines that a significant change has occured it will sms a notification to the remote end. Once the sms is received the user will then connect (via gsm) and veiw the image history around the change.
With the gapi, if the pointer obtained was directly to the screen buffer it would be great. I could create a full screen window and pass that hwnd in then save the pointer then get rid of the window. The ExtEscape dose work well, but tonight I will try doing what you suggested to see if I can get the same result on an older device.
***I just had a thought, I will try using HWND_DESKTOP as the handle, its really just 0 I think but cast to hwnd. The only other time I used it was in mapwindowpoints, but I got some strange results there so I normally stay clear of the desktop window.***
Ok. I did what I said. The behaviour is strange. Using the ExtEscape the pointer I got allowed me to write a colour to the buffer sequentialy, ie I know the start so write this many values of colour into that many bytes and the screen is full. When I try the same idea using gapi, when I copy the memory to the buffer it is not alway contigous. Also the pitch * the x * y may give the correct amount of bytes in the buffer (?) but thery are not arranged in the same layout as the screen, so If I write what I think is the correct amount the screen fillw in a narrow column going off the bottom. The handle I used to open gapi was HWND_DESKTOP, but I do not think this is the problem. It could be that the memory I get from GXBeginDraw is not the actual buffer but is some kind of logical memory that gapi later tries to put in the buffer.
I will next try addressing each pixcel induvidually when writing the colour values.
directly addressing each pixcel worked and now I can set any pixcel on the screen. For example, to make a line 120 pixcels long in the direction of the x axis, starting half way(hard coded to 160) down the screen....
unsigned char* gapiPointer;
void * buf2=NULL;
//prepare gapi
GXOpenDisplay(HWND_DESKTOP,/*GX_FULLSCREEN|kfDirect*/NULL);
//get dimensions
GXDisplayProperties memStat=GXGetDisplayProperties();
long size=1;
buf2=malloc( size );
//set the colour for just one pixcel, ie size is 1 (byte)
memset(buf2,RGB(0,255,255),size);
//get pointer
gapiPointer=(unsigned char*)GXBeginDraw();
if(gapiPointer==NULL)
{
MessageBox(NULL,_T("gapi error"),NULL,MB_OK);
}
else
{
//draw a line
for(int k=0;k<120;k++)
{
memcpy((gapiPointer+(k * memStat.cbxPitch) + (160 * memStat.cbyPitch)),buf2,size);
}
}
//end drawing to free memory
GXEndDraw();
//close gapi
GXCloseDisplay();
free(buf2);
buf2=NULL;
This could realy slow down opperations where a whole block of memory needs to be written. Copying one pixcel at a time is the only way I could get it to work. If there is someone who can show how to copy a whole screen at one time using gapi I would appreciate it.
OdeeanRDeathshead: I may be thinking wrong again (btw, the idea I posted was more for a generic streaming app...) but are you trying to get a screenshot of the main display, or specifically trying to grab the gapi output/overlay?
V
Here's a release of a simple flashlight application I created for the mogul based on code Vijay was kind enough to release a while back. Launch the exe once to turn on the camera light, launch it again to disable.
That's the only feature! I've messaged vijay with the value he needs to update his application with mogul support, so I hope he'll do that in the future if he has time. But until then, I whipped up this.
It might be buggy and it isn't quite the fastest application out there (I wish I knew how to query the camera for the current status of the LED) but it's a neat little tech demo that someone might find useful. I'll post the source code later after I have a chance to clean it up.
Report back with any problems as I've only tested this on my device! (Sprint Mogul)
Also, here's the obligatory "this program could possible harm your device and I take no responsibility for such an event." Use with caution and I wouldn't recommend leaving this on for long periods of time.
I'm using it with AEBPlus and have it bound to my camera key.
GREAT WORK! ya i know.... the reason i made the script is 1 for a safety catch and 2 for ikandy...
the script will turn the light on for 30 sec and hten off... 60 sec the off.. or let u do it manually... i personally know i hit buttons sometimes so i set my side button to the 30 sec script...
heres the beta script the icons dont work perfect yet but hell for those of u who cant wait let me introduce... Flashlight by Nilisco WoW and Stroths
**THIS NO LONGER NEEDS MORTSCRIPT!**
ahhhh we have been waiting for this one...good work guys, can't wait to get this tested!
daclothe said:
ahhhh we have been waiting for this one...good work guys, can't wait to get this tested!
Click to expand...
Click to collapse
thanks but dont give me the credit ... this one is ALL Nilisco
anyone know how to add a icon to it, so when it shows up on my quicklaunch for the HTC home tab, it has a pretty little icon?
cab updated .... mortscript no longer needed
Vijay's code was the key:
Code:
void fn_FlashMode(int Mode_int)
{
HANDLE CamHandle;
//1=on
//2=off
//DWORD FlashMode=1;
//open camera
CamHandle = CreateFile(TEXT("CIF1:"), GENERIC_READ, 0, NULL, 3, 0, NULL);
//Mogul specific device io
DWORD a=0x90002014;
DeviceIoControl(CamHandle, a, LPVOID(&Mode_int), sizeof(Mode_int), 0, NULL, NULL, NULL);
CloseHandle(CamHandle);
}
The only challenge in getting the flashlight working was to find the mogul io, which was right in the htc camera dll. The only way developers can communicate with it (I believe) is the DeviceIoControl win32 function, which is abstracted into functions in the camera dll. So, you just disassemble the driver dll, look for a DeviceIoControl command that looks to have something to do with flash, and bam, you've found the IO as it's a parameter in the function.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I didn't bother with the rest of my code (mainly just win32 registry changes to keep track if the light was on or off) as I believe my program will become a bit outdated as soon as someone posts the VJCandela hack they did without his permission.
I like this a lot. Also I'm impressed with the brightness of the moguls flash.
This works great. Any chance of making a version that stays on only if I am holding the specified button?
Vijay had one of his apps that I could assign to my left side 'press and hold' voice dial key. It would only stay on if I held it down and would also turn off after 15 secs of being held.
The current one works, but I am afraid of it staying on, and would also prefer it to turn off sooner when I am done with it.
So far so good though!
This is awesome!
I like the icons too!
Speaking of device-specific code, has anyone considered writing some code to re-route the audio to the internal handset speaker versus the external amplified one?
There are times that I think it would be useful to have audio coming through the handset... like if I want to play back voice recordings for only me to hear (vs the whole world when I play it out loud), or for VOIP apps like Skype. Right now, most voip apps use the outer loud speaker because every device accesses the internal one differently (or so they say).
This is quite a bit more complicated than a flashlite app, but there aren't enough Titan-specific developers yet to ask this anywhere else!
Figured I'd get your thoughts on this idea... what do you think it would take to write a small app to toggle the direction of audio?
wowthatisrandom said:
GREAT WORK! ya i know.... the reason i made the script is 1 for a safety catch and 2 for ikandy...
the script will turn the light on for 30 sec and hten off... 60 sec the off.. or let u do it manually... i personally know i hit buttons sometimes so i set my side button to the 30 sec script...
heres the beta script the icons dont work perfect yet but hell for those of u who cant wait let me introduce... Flashlight by Nilisco WoW and Stroths
**THIS NO LONGER NEEDS MORTSCRIPT!**
Click to expand...
Click to collapse
Just an FYI, my corporate antivirus picked this file up as a Trojan. Has anyone else noticed this?
kmartburrito said:
Just an FYI, my corporate antivirus picked this file up as a Trojan. Has anyone else noticed this?
Click to expand...
Click to collapse
ho-li-light we have to be careful then.
kmartburrito said:
Just an FYI, my corporate antivirus picked this file up as a Trojan. Has anyone else noticed this?
Click to expand...
Click to collapse
no, that's odd... everything looks clean and works fine for me! I wonder why that would happen?
I put it on this am and it seems to work great. Nilisco might have me by the cajones, but at least I have a flashlight now
Does anyone else have this AND LED-killer 2 running?
LED killer appears to have removed my flashlight icons and replaced them with TREO?!
Weird...
Dishe said:
Does anyone else have this AND LED-killer 2 running?
LED killer appears to have removed my flashlight icons and replaced them with TREO?!
Weird...
Click to expand...
Click to collapse
LED Killer uses the scripticons.dll file for its icon. The flashlight app must have a customized version of this dll with its own icons added. Try uninstalling then reinstalling the flashlight app, soft reset and you will probably be fine. This will cause the flashlight's scripticons.dll to overwrite the LED Killer one.
EDIT: Don't worry about a virus from wowthatisrandom's post. I did a little work with him on this and its clean.
any one know how to add a icon to this exe? its a nice program but sucks that it has no icon...
Keep getting message saying......
Couldn't create directory '\Program Files\Nilisco\Flashlight'
Line:
MkDir( msPath )
Any ideas?
xxdbkxx said:
Keep getting message saying......
Couldn't create directory '\Program Files\Nilisco\Flashlight'
Line:
MkDir( msPath )
Any ideas?
Click to expand...
Click to collapse
You have to install it to main memory. I think I got that message when I tried to install it to the storage card.
sivart321 said:
This works great. Any chance of making a version that stays on only if I am holding the specified button?
Vijay had one of his apps that I could assign to my left side 'press and hold' voice dial key. It would only stay on if I held it down and would also turn off after 15 secs of being held.
The current one works, but I am afraid of it staying on, and would also prefer it to turn off sooner when I am done with it.
So far so good though!
Click to expand...
Click to collapse
if you go to the settings screen and then to buttons, you can reprogram any of the buttons on your device to launch the program. I have my voice recognition speeddial button reset to launch the program. Press it once, it turns on, push it again, it turns off. No need to hold down any buttons.
Here you go the 1st program to measure how hard you stump against a wall.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
MAIN
instant Gforce measure for:
Acceleration/brake (brake is negative)
left/right (left is negative)
Up/Down(up is negative)
Total (always positive)
Speed
GPS
Gps Stats
On/Off
0-...
Test your time from 0 to whatever you chose
(it uses gforce to start the timer)
MAX
Max Values (i know it needs work)
LOG
Chose what you want to log
Log Size
OPTIONS
Set update speed 50 - 1000ms
Use Km over miles per hour
Use Speed in Acc/Brake over Gforce in Main
http://rjsmsampaio.googlepages.com/grafico.jpg
You can get the gflog.txt in you main memory and open in excel
To clean the log just delete it.
X is left/right
y is acc/brake
z is up/down
t is total
Speed
Altitude
Heading
(all this are obvious)
the GFmax is store in gfmax.txt created in main memory.
How to use it correctly:
the pda must be in portrait whit the screen facing the back of the car. When you open the program it will self calibrate(this don't mean you don't need to have your acc calibrated whit other program).
It should read 0.00 whit the car stop in a level area. You can Turn or incline the PDA a little and calibrate again but it will affect the reading if too much off center.
This is the Beta version so post some feedback, im a full time teacher so updates will be constant but not every day
Source code in page 20
Beta vertion 0.25b in page 14
v0.15 0 to x Dynamo
v0.10 Gps integration and KM/Miles options
v0.03 installer
v0.03 maximum Gforce store and logging.
v0.02 New interface, Max working, new formula for Gforce (sorry the first one was wrong a bit) and new formula to calculate Total (thx haggz)
v0.01 First release
http://rjsmsampaio.googlepages.com/Ikari-PtPocketGForce.cab
got the sofaa
Great App my friend. I have tested on aircraft just when taking off and landing and it is great ! didnt use the GPS
Nice one, thanks.
Will have a try.
I've been waiting for this program since Ikari has promised to write... Thanks Ikari... will feedback...
How do you calculate "total"? Judging from the top picture Id say you use
acc + curve = total
which is wrong. Use
total = sqrt(acc^2 + curve^2) instead
Otherwise it looks very nice!
You did get your help! Wonderfull, will download it and have a drive in my car, nice !
Help needed ?
Good job ! I did send you a mail through the forum mail system to offer some help to enhance it. Did you read this ?
Hello.
Perhaps it should be usefull to offer a option to register some infos such as max acceleration.
Thank you for this app.
haggz; said:
total = sqrt(acc^2 + curve^2)
Click to expand...
Click to collapse
I'm not sure about that i whant the total not the movement total.
cgeboers; said:
Good job ! I did send you a mail through the forum mail system to offer some help to enhance it. Did you read this ? )
Click to expand...
Click to collapse
Sorry only read after posting the program any way yes i will need help to improve the program to the maximum. TIME/G graphics etc...
paclep; said:
Perhaps it should be useful to offer a option to register some infos such as max acceleration. )
Click to expand...
Click to collapse
As mention on the first post ins not working at the moment
Any one give me tips to how make a txt file in C#?
As for the rest drive carefully
Why don't you integrate the output signal with respect to time and write also the velocity of device? By this way we can also see the current velocity or also write further 0-100km acceleration values....
Ikari said:
I'm not sure about that i whant the total not the movement total.
Click to expand...
Click to collapse
But you cant just add perpendicular forces since a force is a vector. Break/acc acts straight forward (backwards is "-forward") while curve acts straight right (again, left is "-right"). Draw 2 arrows on a paper, one for acc and one for curve. Then draw the resulting vector. To find the length (in this case the magnitude, or what you call total) use the Pythagorean theorem
total = sqrt(acc^2 + curve^2)
( http://en.wikipedia.org/wiki/Vector_(spatial)#Length_of_a_vector )
haggz said:
But you cant just add perpendicular forces since a force is a vector. Break/acc acts straight forward (backwards is "-forward") while curve acts straight right (again, left is "-right"). Draw 2 arrows on a paper, one for acc and one for curve. Then draw the resulting vector. To find the length (in this case the magnitude, or what you call total) use the Pythagorean theorem
total = sqrt(acc^2 + curve^2)
( http://en.wikipedia.org/wiki/Vector_(spatial)#Length_of_a_vector )
Click to expand...
Click to collapse
That's the idea. Adding them is just incorrect. Cause velocity is a vector, it can be expressed as its moduli times a unitary vector. Taking the derivative with respect to time we will find two sources of acceleration: the one caused by change in time of the modulus (acc) and the one due to the change in direction of the unitary vector (curve). As the derivative of a vector is indeed a vector, you should calculate its modulus. Therefore the total should be what haggz said.
Your app works pretty nice despite that. I have liked it a lot. A way to fix this issue is to display both accelerations separately and then if you like to add them just like numbers at least we will be a little bit more pleased . Anyway congratulations for your great work. Keep it like that !!!
Great for science projects. Great work
I don't know how fast you can read out the sensors. But a great application would be a Time/Acceleration Diagram.
Currently we are measuring oscillations of huge masses.
Would be cool if i could monitor oscillations up to 150Hz.
Great Work!!!
....a quick Example with some text windows:
Looks very nice, but I think a GUI with high contrasts would be better to read while driving.
Unjar to my computer, transfered to my internal storage, attempted to run the program, but it didnt work. It said I needed a newer version of net or something any ideas?
Knochi said:
Would be cool if i could monitor oscillations up to 150Hz.
Click to expand...
Click to collapse
Atm is 4hz but i can test the limit, also depends from the sensor itself.
blazer2004 said:
Unjar to my computer, transfered to my internal storage, attempted to run the program, but it didnt work. It said I needed a newer version of net or something any ideas?
Click to expand...
Click to collapse
download and install .NET Compact Framework 3.5 on your pda and it will work.
One more day and i will release a new version whit DB for the maximum values.
About a graphical interface im not sure how to make one cuz we have 3 axis to display plus the Total so im putting that to the side.
If any one have more ideas for this, new options, features or feedback, plz post.
My car is damage so i cant test everything correctly so make your contributing
Atm im working in a way to measure peek HP and making a time diagram that can be visualize on excel.
Max reading rate
Knochi said:
I don't know how fast you can read out the sensors. But a great application would be a Time/Acceleration Diagram.
Currently we are measuring oscillations of huge masses.
Would be cool if i could monitor oscillations up to 150Hz.
Click to expand...
Click to collapse
I read somewhere, but can't remember where, that default the accelerator readings are performed every 200 milliseconds, which would mean that you have a max of 5 Hz. It is possible to change the value in the registry by using a program that "tweaks" it, but I don't know what it would mean for the battery life.
Maybe your program could set the readings faster while it is running, but I don't have a clue how you would have to do it.
Never the less, 150 Hz might be a bit too fast for WM6.1, even with a fast processor ?
Hi,
Here is a small application which uses the accelerometer and draws a small graph. It uses the g-sensor managed DLL from Koushilk Dutta (and you'll need the .Net Compact Framework 3.5 to run this on your Diamond)
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Here is the CAB : SeismoCAB (61KB)
Edit: 20th sept. version 0.12 of my Seismosaur detector
zoom in/out with nav button (circle clockwise / counter clockwise)
close button
screen should not turn black while Seismo is running
now the scale is inverse tangent like
Have fun (though fun won't last for a long time with this )
PS: and I already know that this is silly and useless, and ugly...
nice tnx. downloading now.
(the best GODZILLA detector there is XD
Thanks in deed... I was just looking forward for this thing... Pencil is a cute user interface
Just a couple of question or feedback let's say:
-- The seismo in iphone was much more sensitive than ours... Even somebody's walking in the room was enough to disturb needle. Is it all about hardware? The response of accelerometer?
-- This lovely program is only deviating in "normal direction to screen" as far as i observed... I haven't seen a real seismograph, but is it always the case? Or should it react against the "resultant acceleration of three directions"
Thanks for the program...
Great APP, I've waited long for Seismograph for Diamond.
However it would be nice to:
1) change the pencil with the proffesional needle image?
2) make it more sensitive (or let us choose the sensitivity ),
3) prevent the screen from fading when the APP is running,
4) add some sound?,
5) add the possibilty to save the session,
6) maybe add the Richter scale meter somewhere underneath?
Heh, a long list, but I hope it will help to improve the APP
Haha... Love it!
emre_aachen said:
Thanks in deed... I was just looking forward for this thing... Pencil is a cute user interface
Just a couple of question or feedback let's say:
-- The seismo in iphone was much more sensitive than ours... Even somebody's walking in the room was enough to disturb needle. Is it all about hardware? The response of accelerometer?
-- This lovely program is only deviating in "normal direction to screen" as far as i observed... I haven't seen a real seismograph, but is it always the case? Or should it react against the "resultant acceleration of three directions"
Thanks for the program...
Click to expand...
Click to collapse
I'm not sure about the sensitivity, maybe it's the scale i've used (a logarithmic one may be needed, as the iPhone version has)... I'll try some adjustments... but i'm not trying to compete with the iPhone version here nor the results can be compared. iPhone's Seismometer measures some "energy" and not the raw acceleration. Maybe they square it or they integrate it, i don't know...
You are also right: I'm only measuring "up and down" accelerations. It could also use the norm of the vector if you think that it makes more sense.
gerDiamond said:
I'm not sure about the sensitivity, maybe it's the scale i've used (a logarithmic one may be needed, as the iPhone version has)... I'll try some adjustments... but i'm not trying to compete with the iPhone version here nor the results can be compared. iPhone's Seismometer measures some "energy" and not the raw acceleration. Maybe they square it or they integrate it, i don't know...
You are also right: I'm only measuring "up and down" accelerations. It could also use the norm of the vector if you think that it makes more sense.
Click to expand...
Click to collapse
Here my ideas for processing of raw data coming out of port:
1- As you've suggested, a log scale may let you magnify the result. Actually it will not magnify but it will let the output be scaled on a narrower band (visually). it means you will have a bigger space to plot data's. So you can increase the output by some constant (multiply with 10 let's say), or even maybe take the cube of the output (taking square will cause problem because negative results will turn into positive then) So we can see even the very small disturbances. and since you use log scale, big oscillations will also not be problem, they will nicely fit on your log scale.
2- Secondly norm of the vector seems like a better idea. Because we're not looking for something scientific or something based on real scales, you can use a resultant vector. The users only want to see the movement of your pencil in any case of disturbance. So sqrt(x'2+y^2+z^2) will be a more useful raw data output just before multiplying with proportional constant and scaling on log paper.
One more time thanks for your effort....
Very very very cool.
thanks very much for your time and effort
Highly appreciated.
works flawesly no probs with sensitivity HR...try to put Dia od table and you will see some vibrations even without any "seismic activity: so maybe appreciate option to stabilise common distorsions caused by HW such a very small iregular deviations...but leave to measure also this small distorsions so to do some switch...but very very amazing app...
I hate iPhone and iPhonemania but its good inspirations for all WM community
Very nice app.
Some suggestions
-exit button
-You can also do this with sound (decibel meter?)
-scale option
-real needle image
Great work so far thanks
Thanks for your feedback and suggestions, I'll try to improve this draft - I did not spend a lot of time on this as you may have guessed
I'll try first to change the scaling, find or draw a "needle" picture and have an exit button.
Stay tuned...
I was finishing my seismo program last nigth but you got ahead
Aldo my program have more features yours have a lot better interface, this was my second WM program so i think its normal, could you share the sorce code so i see how you make the graph?
And i can share my formulas white you to, i was using this web site as base to all my formulas http://earthquake.usgs.gov/learning/topics/measure.php
Thx in advance
Hi Ikari,
I had seen the thread where you said that you may code something, but at this time my small Seismo was already on its way...
Of course I'll post my C# solution on this thread this evening/night (European time too) when i get back home and have 5 free minutes
Feel free to use it!
where I can take .net 3.5??
==> .NET Compact Framework 3.5 Redistributable
To Ikari - and all those interested - here is a link to the current zipped solution (VS 2008):
SeismoMeter.zip (696 KB)
The few interesting things are in SeismoMain.cs...
Video of the app here.
http://wmpoweruser.com/?p=1018
Surur
really cool app. kudos from me
several small questions - would it be possible to somehow save the data / the graphs?
and it'd be cool if the device didn't go to sleep after the wm-preset time...
Very nice one.. I wouldt be nice to save the graphs and for example put the phone on the table and If your girlfriend/wife took it for a few moments then put it back.. you can see that ... just an ideea
Nice app!
What to add a fullscreen mode ?
Another little game from me today.
This uses the same basic framework as BallPhysics, but applies it in a different way.
It's pong, where your paddle is controlled by tilting the device.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
The controls:
Up/Down change the balls speed.
Left/Right change the CPU paddle speed
Centre pauses
The text:
In the bottom left is the time in milliseconds since the last restart
In the bottom right is the current score
Should work on Diamond, Raphael, Blackstone, Rhodium and Topaz.
It's written in C++/win32, so no nothing apart from the exe is needed.
Configuration:
Code:
HKCU\Software\l3v5y\GravityPong
FixedVelocity=
if < 0, velocity is variable, if > 0, FixedVelocity is the difference between the CPU speed and your paddle speed
Changelog
0.4 - uses trig to calculate the initial ball speed so the ball travels at one speed regardless of angle, some little performance tweaks
0.3 - adds configuration of speed, and exit if mouse is within top 40 pixels of screen.
0.2 - Fixes sensor polling, and possible odd background
0.1 - Initial release
Nice!!!
I will try it right now!
[EDIT] The idea is nice, but controlling the paddle isn't working very well for me (it's almost not responding to my movements at all), and after 5 sec. it will be in a loop.
I loaded this game onto my Touch Pro. Here is what happened:
1. Worked for about 15 seconds. Then my paddle would not respond to any movement. I tried back and forth, up and down, side to side, hard and soft shaking.
2. Shut down and tried a soft reset. Started game again and all I got was a colorful static screen but could still see the paddle moving with its white tail in the fore ground. Did I describe that well enough to understand?
This game seems like it could be really cool but seems to have some issues.
Any ideas?
Joe_PDA said:
I loaded this game onto my Touch Pro. Here is what happened:
1. Worked for about 15 seconds. Then my paddle would not respond to any movement. I tried back and forth, up and down, side to side, hard and soft shaking.
2. Shut down and tried a soft reset. Started game again and all I got was a colorful static screen but could still see the paddle moving with its white tail in the fore ground. Did I describe that well enough to understand?
This game seems like it could be really cool but seems to have some issues.
Any ideas?
Click to expand...
Click to collapse
Okay.
I think I've found the cause of both of those.
1. I was polling the sensor too often causing it to try and check again before it had finished the previous check.
2. I haven't noticed this, but filling the background with a black fill should sort it.
Can you try the attached and see if it works?
Thanks
A question for potential users of this:
Anyone interested in the possibility of bluetooth based multiplayer?
As in, you pair with another HTC sensor enabled device and can control one paddle while the paired device controls the other?
I ask as I've just found some sample code in the WM6 SDK for "BthChat", that could provide the data transfer framework...
Tnx, works better now.
Still it's hard to get the paddle "stable", but it works.
johanromijn said:
Tnx, works better now.
Still it's hard to get the paddle "stable", but it works.
Click to expand...
Click to collapse
Would you prefer the sensitivity to be lower?
I could probably make it configurable, but I'd need a settings app/screen to do so. If wanted, I'll do it...
l3v5y said:
Would you prefer the sensitivity to be lower?
I could probably make it configurable, but I'd need a settings app/screen to do so. If wanted, I'll do it...
Click to expand...
Click to collapse
Maybe it would be better that if you tilt your device to the left it will move to the left at a static speed. (not moving very fast if you tilt it more)
Now it's bouncing from all left to all right, it's hard to control.
I hope you get what I mean. Maybe it's just me who can't play this game
Nicely done and fast too
Thanks for the lightening fast update. This is much better now. Really cool. Your are on to something really good here. A few comments:
1. I agree it is a bit hard to control. configurable would be the way to go.
2. Can you make the scoreboard a bit larger?
3. Maybe a pause button and exit button?
4. Bluetooth multiplayer would be a cool feature.
Based on your lightening fast work, can we expect the new version in the next 20 minutes?
just kidding . I have a short attention span.
Joe_PDA said:
Thanks for the lightening fast update. This is much better now. Really cool. Your are on to something really good here. A few comments:
1. I agree it is a bit hard to control. configurable would be the way to go.
2. Can you make the scoreboard a bit larger?
3. Maybe a pause button and exit button?
4. Bluetooth multiplayer would be a cool feature.
Based on your lightening fast work, can we expect the new version in the next 20 minutes?
just kidding . I have a short attention span.
Click to expand...
Click to collapse
Those updates were about 5 lines of code
1. Configurable is about 10 lines of code (it'll be registry based, I might make a config app later)
2. Scoreboard font size is one number, so that's easy.
3. Centre button on DPAD (or return on a keyboard) will pause it, although the timer in the bottom left may continue to run
4. That may take longer as I need to find a device I can test it on (I only have on Diamond, and my Prophet doesn't do gsensors..)
Good news, awaiting update. On this post have you gotten rid of the older version so people only download the best one? Keep up the good work. You seem to be good at writing apps for the G-sensor. Are you working on any other games/programs?
I would like to see the following:
1. A good Magic 8 Ball. What I've found out there doesn't seem to work well on the Touch Pro G-Sensor.
2. A configurable Spinner. Something like the Spin the Bottle app but one that lets us put in backgrounds, like numbers 1-6 or words like ("drink one shot") etc.
3. A good configurable dice roller.
Thanks for your hard work.
johanromijn said:
Maybe it would be better that if you tilt your device to the left it will move to the left at a static speed. (not moving very fast if you tilt it more)
Now it's bouncing from all left to all right, it's hard to control.
I hope you get what I mean. Maybe it's just me who can't play this game
Click to expand...
Click to collapse
I get what you mean.
In the update I'm just uploading the speed is fixed at one above the CPU speed, but you can change it to variable in the registry
Code:
HKCU\Software\l3v5y\GravityPong
FixedVelocity=
if < 0, velocity is variable, if > 0, FixedVelocity is the difference between the CPU speed and your paddle speed
0.4 is now released.
Some performance tweaks, and a change to the ball velocity.
At mines it doesn't work
Then it says unable to load Sensor DLL or something like that im using samsung omnia i900 and i downloaded microsoft frame thing plz help
such poor quality games for the Diamond . as the iPhone has great games with brilliant graphics and gameplay. and we pretend PONG is fun.
daJudge2010 said:
such poor quality games for the Diamond . as the iPhone has great games with brilliant graphics and gameplay. and we pretend PONG is fun.
Click to expand...
Click to collapse
ummm...then go buy and iphone.
great game btw.
ps. pong IS fun
>>>>>>>>>>>>>>>>>>>>>>>>>>