The vibration in the Android mobile phone is implemented by vibrator. To set a vibration event, you need to know the duration and cycle of the vibration.
In Android, the vibration time is calculated in one millisecond (1/1000 seconds). Therefore, if the set time value is too small, it cannot be felt.
Call vibrate (long [] pattern, int repeat) of vibrator.
The previous parameter is an array of effects for vi
1, get the handle of vibration serviceVibrator = (Vibrator) getsystemservice (Vibrator_service);OrVibrator = (Vibrator) getapplication (). Getsystemservice (Service.vibrator_service);2. start shaking with two interfacesVibrator.vibrate (2000);//vibration specified time, data type long, in milliseconds, 1/1000 seconds per millisecondVibrator.vibrate (new long[]{100,10,100,1000},–1);Vibrate according to the s
Tip: the code can be modified before running!
I just learned JavaScript and saw some cool people write a lot of special effects. I also spent a day writing a spring vibrator, which was completely original and did not learn from anyone's code, here I am running my compressed version code (some cards are running on the internet). I will upload the full version and the Code with comments (which is very detailed, the first time I posted code in my blog,
Last year just finished Ugui, want to be a snake games ~The result, of course, is that, like most program apes, the core operating logic is implemented, and the rest is behind.But yesterday on the Internet to see the same as I this demo post, I snake snake Head is also copied, this really can not endure, or the original put out good ~--- point here ---So simple Chinese + Pinyin programming style I'm afraid I have the nerve to use.Using system;using unityengine;using unityengine.eventsystems;usin
Unity3d 5.0 Project exported to the Android project, in the Unityplayeractivity.java inside the onkeydown and some key press events can not hear the rocker axis key press, is X, Y, Z, RZ axis data (actual joystick), Modifying the Meta-data in the Androidmanifest.xml file can be resolved,Reference: http://forum.unity3d.com/threads/cant-get-onkeydown-event-in-mainactivity-with-unity-4-3-1-exported.218437/http://forum.unity3d.com/threads/cant-get-onkeydo
Friends who are used to ThinkPad will be more accustomed to using the red joystick, because they are no less familiar with the common mouse.
However, after ubuntu (11.04) is installed, this function is not enabled by default. You can find it online and summarize it as follows:
If your system is a version earlier than ubuntu10.10, edit/etc/X11/Xorg. conf and find:
Section "inputdevice"
Identifier "configured mouse"
Driver "Mouse"
# Add the followin
I looked at Yu Song Momo's joystick. It's good, but I don't think it's comprehensive, and there are only eight directions (maybe it's the reason for setting the angle to 90 degrees ), below is a simple method for improvement. The basic operation is the same as that of Yu Song Momo, which is the control script.CodeChanged.
My code is as follows:
VaR touchkey_x = movejoystick. position. X; var touchkey_y = movejoystick. position. Y; If (touchkey_x = 0
I looked at Yu Song MOMO's joystick. It's good, but I don't think it's comprehensive, and there are only eight directions (maybe it's the reason for setting the angle to 90 degrees ), below is a simple method for improvement. The basic operation is the same as that of Yusong MOMO, that is, the code of the control script has changed.My code is as follows:[Java]Var touchKey_x = moveJoystick. position. x;Var touchKey_y = moveJoystick. position. y;If (tou
1. Introduce
Cocos2d for us to provide a good joystick controller, mainly for the ZJoystick.h and ZJOYSTICK.M add to achieve the following diagram function. You can control the movement of the sprite in the diagram by using a joystick. (But there is still a technical problem to be solved, that is, the sprite will be moved after a shadow left in the original position)
2. The realization of the rocker pol
Fully in line with conservation of energy, the JavaScript spring vibrator of the Hulk theorem (ultra-simplified version, beyond the first version !) The last version used physical thoughts. This time it used mathematical ideas. If you have downloaded the first version of the code, you will obviously feel the power of mathematics !!!!!
Here is the JS Code of spring:
The Code is as follows:
As for where to buy vibration massager , it is recommended that you go to the "Spring Fun app"▓██▓██▓██▓██▓██▓██▓██▓ search Spring Fun app, learn more about it.Baidu " Spring fun app", Spring is a special design for the user to buy Qing interesting items of interest in the auxiliary platform, where you can be Qing fun to buy, but also with a variety of crazy male infatuated hi talk About Love is what, Qing fun, about posture skills, community exchange no moral integrity are waiting for your co
The SensorDemo routine provided by TI is very good. With ZigBee Sensor Monitor, you can also observe the network topology of ZigBee.
However, according to the original SensorDemo, collector, router, and enddevice both have corresponding buttons or joystick to operate in order to establish a network and send data.
1. Add another configuration-RouterEB
Open the SensorDemo Project, find Edit Configurations under the Project menu, and click the New button
) self.critsprite = Display.newsprite (self.frames[1]) : addto (display: Getrunningscene (), Second_menu_z_order) Self.critSprite:setScale (0.6) animation = Display.newanimation ( Self.frames, 1/9) Transition.execute (self.critsprite,ccanimate:create (animation), { OnComplete = function ( ) end}) Self.critSprite:playAnimationForever (animation) EndThe final results are as follows:What are the problems that we can exchange
The reason for writing this article is mainly because the virtual reality is very popular now, but the mainstream virtual reality device (HTC VIVE) Tutorial is less pitiful, this I have deep experience. therefore, I would like to develop in my usual problems and solutions to record down, share to everyone, if there is any mistake or what better plan we also please point out that we learn from each other, Haha.okay, just on the Code.Using unityengine;using System.collections;public class Shoubing
Create a new class. For example, Mysurfaceviewpackage com.example.blt;import android.annotation.suppresslint;import android.content.context; import android.graphics.canvas;import android.graphics.color;import android.graphics.paint;
high simulation spring vibrator (compression version) after setting, activate the element and click me !! after running, please activate it again initial speed (unit: pixel/millisecond ): moving interval (unit: milliseconds ): half-cycle
The last version used physical thoughts. This time it used mathematical ideas. If you have downloaded the first version of the code, you will obviously feel the power of mathematics !!!!!Here is the JS Code of spring:Copy codeThe Code is as follows:
The general vibration time is configured in the following file:
Copy Code code as follows:
Frameworks/base/core/res/res/values/config.xml
0
1
20
21
0
10
20
30
40
0
1
20
21
0
1
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.