×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 27

Thread: N95 Shake

  1. #1
    Super Contributor
    Join Date
    Feb 2008
    Location
    Belo Horizonte, Brazil
    Posts
    744

    N95 Shake

    Please, does someone knows what's the code for using the shake on the N95? I think that I have to use the aXYZ module, right? So, how can I adjust the variation of the axyz? Some one please give an example source! Thanks!

  2. #2
    Nokia Developer Expert
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,142

    Re: N95 Shake

    have you already checked SDK docs for CHWRMVibra API.

  3. #3
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,777

    Re: N95 Shake

    Quote Originally Posted by Rafael T. View Post
    Please, does someone knows what's the code for using the shake on the N95? I think that I have to use the aXYZ module, right? So, how can I adjust the variation of the axyz? Some one please give an example source! Thanks!
    I don't get you. Do you want your device to vibrate? Or you want to triggerer something with the orientaation ?
    If the latter you have to use the Axyz module in python.

    Best Regards
    Croozeus
    Pankaj Nathani
    www.croozeus.com

  4. #4
    Nokia Developer Expert
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,142

    Re: N95 Shake

    I don't think you can get your phone to shake by changing any sensor values really. Also you can use C++ on reading the sensor info, you do not need to use python for it.

  5. #5
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,777

    Re: N95 Shake

    If you want your mobile to vibrate using PyS60 you can do it by using miso

    Have a look at this example on Wiki

    Best Regards
    Croozeus
    Pankaj Nathani
    www.croozeus.com

  6. #6
    Super Contributor
    Join Date
    Feb 2008
    Location
    Belo Horizonte, Brazil
    Posts
    744

    Re: N95 Shake

    No, my idea is not to get the phone to vibrate! Is to shake the phone and then the phones do something, like ShakeLock, ShakeSMS, ShakeMe and etc (only accelerometer devices). I know I have to use axyz module but whats the code for the variation of tha axyz? I mean, whats the code for the app interpret this shake?

    Thanks!

  7. #7
    Super Contributor
    Join Date
    Feb 2008
    Location
    Belo Horizonte, Brazil
    Posts
    744

    Re: N95 Shake

    nobody has any ideias???

  8. #8
    (Retired) Nokia Developer Admin.
    Join Date
    Jan 2006
    Location
    Michigan
    Posts
    4,664

    Re: N95 Shake

    Are you looking for something like shakerracer?
    http://blogs.forum.nokia.com/blog/an...ow-open-source

    Ron

  9. #9
    Super Contributor
    Join Date
    Feb 2008
    Location
    Belo Horizonte, Brazil
    Posts
    744

    Re: N95 Shake

    Yeah, this helps, thanks. The ideia is to shake the phone (N95, N95 8GB, N82, N93i, 5500) and the music player changes the music, just like shake control from Sony Ericsson.

  10. #10
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,777

    Re: N95 Shake

    Quote Originally Posted by Rafael T. View Post
    Yeah, this helps, thanks. The ideia is to shake the phone (N95, N95 8GB, N82, N93i, 5500) and the music player changes the music, just like shake control from Sony Ericsson.
    Oh okay, You may need to use the sensor module.
    Search the forum for keyword "Sensor"

    Best Regards
    Croozeus
    Pankaj Nathani
    www.croozeus.com

  11. #11
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,355
    -- Lucian

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

  12. #12
    Super Contributor
    Join Date
    Feb 2008
    Location
    Belo Horizonte, Brazil
    Posts
    744

    Re: N95 Shake

    Thanks for all the help. Does any one have a example code for the accelerometer sensor? And what or the diferences between Sensor module and aXYZ module?

  13. #13
    Super Contributor
    Join Date
    Feb 2008
    Location
    Belo Horizonte, Brazil
    Posts
    744

    Re: N95 Shake

    I tried this:

    Code:
    import appuifw
    import sensor
    import audio
    import e32
    
    
    sensor_type = sensor.sensors()['AccSensor']
    acc_sensor = sensor.Sensor(sensor_type['id'],sensor_type['category'])
    acc_sensor.set_event_filter(sensor.AccEventFilter())
    
    def get_sensor_data(status):
    
    if status == elif z < 20 and z > -20:
     elif y < -20:
    
    audio.say(u"Success")
    
    def item1():
        appuifw.note(u"Your text here", "info")
    
    def quit2():
    
        acc_sensor.disconnect()
    
        app_lock.signal()
    
        appuifw.app.set_exit()
    
    def quit():
    
        acc_sensor.disconnect()
    
        app_lock.signal()
    
        appuifw.app.set_exit()
    
    
    
    appuifw.app.menu = [(u"About", item1),
                        (u"Exit", quit2)]
    
    
    acc_sensor.connect(get_sensor_data)
    
    appuifw.app.screen='normal'
    
    appuifw.app.title = u"Test"
    
    appuifw.app.exit_key_handler = quit
    
    app_lock = e32.Ao_lock()
    
    app_lock.wait()



    No success, it returns IndentationError: expected an intended block(MT.py, line 13)


  14. #14
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,777

    Re: N95 Shake

    Hi Rafael,

    Yes there seems an indent error in the definition of 1st function.
    Use 4 indentations in the 1st function as you have done in other cases.

    Best Regards
    Croozeus
    Pankaj Nathani
    www.croozeus.com

  15. #15
    Super Contributor
    Join Date
    Feb 2008
    Location
    Belo Horizonte, Brazil
    Posts
    744

    Re: N95 Shake

    Croozeus,

    Do you mean I need to use like this?

    Code:
    if y < 10 and y > -10:
     if z < 20 and z > -20:
    
    audio.say(u"Success")
    Does any one has any source code of the Acc Sensor?

    By the way, I have replied your e-mail, croozeus


    BG

    Rafael.

Page 1 of 2 12 LastLast

Similar Threads

  1. Another N95 and Wifi problem
    By ric9887 in forum Wired and Wireless interfaces (Closed)
    Replies: 3
    Last Post: 2009-07-15, 08:05
  2. N95 Accelerometer & JSR-256
    By AnthonyAndrews in forum Mobile Java General
    Replies: 9
    Last Post: 2009-04-21, 22:12
  3. Replies: 84
    Last Post: 2008-03-04, 23:25
  4. Classic N95 vs US ver. N95
    By qwerty0824 in forum General Development Questions
    Replies: 5
    Last Post: 2007-09-13, 18:09
  5. N95 Some Questions & Suggestions
    By subzero_brighton in forum General Development Questions
    Replies: 0
    Last Post: 2007-06-22, 15:37

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •