Discussion Board

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

Thread: N95 Shake

  1. #1
    Super Contributor Rafael T.'s Avatar
    Join Date
    Feb 2008
    Location
    Belo Horizonte, Brazil
    Posts
    744
    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 symbianyucca's Avatar
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    28,664
    have you already checked SDK docs for CHWRMVibra API.

  3. #3
    Nokia Developer Moderator croozeus's Avatar
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,635
    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 symbianyucca's Avatar
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    28,664
    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 croozeus's Avatar
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,635
    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 Rafael T.'s Avatar
    Join Date
    Feb 2008
    Location
    Belo Horizonte, Brazil
    Posts
    744
    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 Rafael T.'s Avatar
    Join Date
    Feb 2008
    Location
    Belo Horizonte, Brazil
    Posts
    744
    nobody has any ideias???

  8. #8
    (Retired) Nokia Developer Admin. Nokia Ron's Avatar
    Join Date
    Jan 2006
    Location
    Michigan
    Posts
    4,664
    Are you looking for something like shakerracer?
    http://blogs.forum.nokia.com/blog/an...ow-open-source

    Ron

  9. #9
    Super Contributor Rafael T.'s Avatar
    Join Date
    Feb 2008
    Location
    Belo Horizonte, Brazil
    Posts
    744
    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 croozeus's Avatar
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,635
    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

  12. #12
    Super Contributor Rafael T.'s Avatar
    Join Date
    Feb 2008
    Location
    Belo Horizonte, Brazil
    Posts
    744
    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 Rafael T.'s Avatar
    Join Date
    Feb 2008
    Location
    Belo Horizonte, Brazil
    Posts
    744
    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 croozeus's Avatar
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,635
    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 Rafael T.'s Avatar
    Join Date
    Feb 2008
    Location
    Belo Horizonte, Brazil
    Posts
    744
    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
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved