#with buttonx
Explore tagged Tumblr posts
Text
Serie vs Series
Context: Math, talking about a collection of numbers.
"Serie" is not an English word.
We say "series" for both singular and plural.
e.g. Click ButtonX to graph a single series or ButtonY to graph multiple series.
0 notes
Text
[Mini-Review] Aloof - Nintendo Switch
[Mini-Review] Aloof – Nintendo Switch
Developer: ButtonX | Publisher: RedDeerGames | Release Date: 15/10/2021Price: $4.99/£4.99 | Review Code Provided by the Publishers | Genre:Puzzle, Adventure, Simulation, Strategy | Platform: Nintendo Switch Story/Description Protect your little islands in this unique puzzle-battler with adorable animals! CHALLENGING EXPERIENCE WITH CUTE ANIMALSEnter the colorful world of Aloof, where…
View On WordPress
0 notes
Link
Aloof free download PC game cracked with direct hyperlinks and torrents. Aloof is a puzzle fighter like Puyo Puyo Tetris, however the play is totally totally different. On this planet of Aloof, summon and defend small islands whereas constructing combos … Overview of the game Developer: ButtonX the publisher: ButtonX Release date: March 25, 2021 …
Aloof Read More »
0 notes
Link
One small thing I wanted to do is make one Sonoff light switch work another - a simple two may light switch arrangement, such as top and bottom of stairs, etc. Obviously, one can use a home automation server like home-assistant, but I am trying to keep it a bit simpler at the moment. I have an MQTT broker (actually on a Pi) and that allows any of the MQTT devices I have to talk to each other. Some devices, like my door entry, and alarm system have a means to send a series of MQTT messages on various events already. It seems Tasmota / Sonoff can do what I want, but there were a couple of challenges, and reading some blogs I see I am not alone. So here is what I found and what is a gotcha or two.
The set up
What I was trying to do was have a light switch that controlled another - a simple two-way light switch arrangement (which is what it used to be). Either light switch ("button") when pressed would toggle the light, simple. I had another case where I wanted one button to control 4 lights, but we'll come to that later.
ButtonTopic
The simple answer is to set the ButtonTopic on the extra switch and tell it that the topic to use is the first switches. This should just work. But...
You cannot set the ButtonTopic if you are sending a group message, which it thinks you are if the name of the GroupTopic is a substring of the Topic of the device, which is just silly. The result is a status saying ButtonTopic is still "0". No error, just confusing. I had to read the code to find this. I had Bed1LS as a GroupTopic and Bed1LS3 as the device Topic. As a result I could not set the ButtonTopic to anything!
I don't think you can use the ButtonTopic if it is set to the same as the device GroupTopic (from looking at the code). So even changing GroupTopic and changing back to set ButtonTopic would not work in the above case. I am not totally sure why, unless it creates some sort of loop, but I cannot see why it would and it would be better to fix that than to silently ignore it.
You can only set a system wide ButtonTopic, not a topic for each button if you have several buttons. This is OK on a simple button switch, obviously.
You set the ButtonTopic just to the name, without the cmnd/ prefix or /Power suffix. It adds those - which was not obvious.
Note, ButtonTopic replaces the normal relay operation unless MQTT is not available.
Request: Please can we have a ButtonTopic1/2/etc for each button?
Request: Can we please avoid the loop or whatever stops use of the GroupTopic as ButtonTopic?
Request: Why is grpflg set using strstr hence meaning it is set when talking to a device where group is subset of device topic. I can see group being subset of device as quite common?
Rules
Rules are another good way to do things and are mode flexible. You can make a rule so that pressing the button publishes on MQTT. You can have more than one sequence on a rule.
You simply send something like :-
cmnd/Bed1LS3/Rule1 on Button1#state do publish cmnd/Bed1LS/Power1 TOGGLE endon
And you can add a second part to the rule, e.g.
cmnd/Bed1LS3/Rule1 +on Button1#state do publish cmnd/Bed1LS/Power2 TOGGLE endon
I had to add two parts because the lights switches where double, and so needs Power1 and Power2 set.
It looks like the Rule and ButtonTopic do not work together which is odd.
I could not publish a command with spaces in it, such as Backlog (to change both Power1 and Power2 together). Maybe there is a trick to that. Hence I had two parts to the rule.
Note, a rule on ButtonX replaces normal relay operation. A rule on PowerX happens when power changes which could be because of normal button control of power. You can test Power1#state=0 and Power1#state=1 if you don't want to use TOGGLE.
Request: Can we have it so Power (rather than Power1 or Power2) applies to all power controls so that one message could toggle or control all lights on a multiple button light switch?
Request: Can we publish something with spaces in somehow?
However, end result is good :-)
Update: You can use Backlog in the command, which works well. E.g. cmnd/GardenLS0/Rule1 on Button1#state do Backlog Publish cmnd/GardenLS1/Power 2;Delay 2;Publish cmnd/GardenLS2/Power 2;Delay 2;Publish cmnd/GardenLS3/Power 2;Delay 2;Publish cmnd/GardenLS4/Power 2;Delay 2;Publish cmnd/GardenLS5/Power 2;Delay 2;Publish cmnd/GardenLS6/Power 2; endon
via www.me.uk RevK's rants
0 notes
Text
マウス
マウスから直接得られる情報は、画面上のXY座標、左右のボタンが押されているかどうか、だけですが、ソフトウェアで処理すれば、移動速度、方向、領域内にあるかどうか、などを調べることができます。
マウスの位置
mouseX マウスのX座標を保持している変数
mouseY マウスのY座標を保持している変数
マウスと対象物の距離
dist( X1, Y1, X2, Y2) 点1と点2の距離を計算する関数
例:マウスが近づく程、線が太くなる。
void setup() { size(500, 500); }
void draw() { background(255); float weight = dist( mouseX, mouseY, width/2, height/2 ); strokeWeight( (1.0/weight) * 500 ); line( mouseX, mouseY, width/2, height/2 ); }
マウスの移動速度
1フレーム前のマウスカーソルの位置と、現在の位置を比較すれば、マウスのスピードがわかります。
pmouseX 1フレーム前のマウスのX座標を保持している変数
pmouseY 1フレーム前のマウスのY座標を保持している変数
例:マウスを早く動かすと、濃い色で線が描かれる
void setup() { size( 500, 500 ); strokeWeight(50); }
void draw() { background(255); float distance = dist( mouseX, mouseY, pmouseX, pmouseY); distance = constrain( distance, 0, 255 );//0~255の範囲に納める distance = 255 - distance;// stroke( distance ); line( mouseX, mouseY, pmouseX, pmouseY); }
マウスと対象物の角度
atan2( Y, X ) (0, 0)から(X, Y)への角度を計算する関数。
例:マウスカーソルの方向を向く
void setup() { size( 500, 500 ); rectMode(CENTER); strokeWeight(3); }
void draw() { background(255);
fill(255); ellipse( width/2-50, height/2, 100, 100); ellipse( width/2+50, height/2, 100, 100);
float angle = atan2( height/2 - mouseY, width/2-50 -mouseX ); pushMatrix(); translate(width/2-50, height/2); rotate( angle ); fill(0); ellipse( -25, 0, 50, 50); popMatrix();
angle = atan2( height/2 - mouseY, width/2+50 -mouseX ); pushMatrix(); translate(width/2+50, height/2); rotate( angle ); fill(0); ellipse( -25, 0, 50, 50); popMatrix(); }
マウスの当たり判定(円形)
マウスが、円形の物と重なっているかどうかは、円の中心とマウスカーソルの距離を調べます。半径よりも小さければ重なっていて、大きければ重なっていません。
例:カーソルが円の内側なら赤く塗り、外なら白く塗る
void setup() { size( 500, 500 ); }
void draw() { background(255);
float buttonX = 250;//ボタンのX座標 float buttonY = 250;//ボタンのY座標 float radius = 100;//ボタンの直径
float distance = dist( mouseX, mouseY, buttonX, buttonY); if ( distance < radius/2 ) { //ボタンの中 fill( 255, 0, 0 ); } else { //ボタンの外 fill( 255, 255, 255 ); }
//ボタンを描く ellipse( buttonX, buttonY, radius, radius ); }
マウスの当たり判定(矩形)
矩形の内側にマウスカーソルがあるかどうかは、4つの条件が同時に成り立つかどうかを調べることで分かります。
void setup() { size( 500, 500 ); }
void draw() { background(255);
float buttonX = 250;//ボタンのX座標 float buttonY = 250;//ボタンのY座標 float buttonW = 100;//ボタンの横幅 float buttonH = 50;//ボタンの高さ
//4つの条件が全て成り立つならば if ( (mouseX > buttonX) && (mouseX<buttonX+buttonW) && (mouseY>buttonY)&&(mouseY<buttonY+buttonH)) { //ボタンの中 fill( 255, 0, 0 ); } else { //ボタンの外 fill( 255, 255, 255 ); }
//画面の中央にある直径200pxのボタン rect( buttonX, buttonY, buttonW, buttonH ); }
マウスのボタン
mousePressed マウスのボタンが押されているかどうかを保持する変数。押されていればtrue、いなければfalse。随時チェックする必要があるので、draw()ブロックの中で、if文と合わせて使います。
例:ボタンが押されていれば、「PRESS」と表示する
void setup() { size(500, 500); }
void draw() { background(255); if ( mousePressed ) { println("PRESS"); } }
mouseButton 押されたボタンが右(RIGHT)か左(LEFT)かを保持する変数。
例:右ボタンが押されていれば「RIGHT」、それ以外なら「LIGHT」と表示する。
void setup() { size(500, 500); }
void draw() { background(255); if ( mousePressed ) { if ( mouseButton == RIGHT) { println("RIGHT"); } else { println("LIGHT"); } } }
void mousePressed(){} マウスのボタンが押された瞬間に1度だけ呼び出される関数。
例:ボタンが押されたら1度だけ「PRESS」と表示する
void setup() { size(500, 500); }
void draw() { background(255); }
void mousePressed() { println("PRESS"); }
void mouseReleased(){} マウスのボタンが離された瞬間に、1度だけ呼び出される関数
例:ボタンが離されたら1度だけ「RELEASE」と表示する
void setup() { size(500, 500); }
void draw() { background(255); }
void mouseReleased() { println("RELEASE"); }
ワーク
円形のボタンを画面の中央に表示し、通常はグレー、カーソルと重なった時は黄色、重なった状態でマウスの左ボタンを押したら赤、右ボタンを押したら青で塗るプログラムを作ってください。
void setup() { size( 500, 500 ); }
void draw() { background(255);
float buttonX = 250;//ボタンのX座標 float buttonY = 250;//ボタンのY座標 float radius = 100;//ボタンの直径
float distance = dist( mouseX, mouseY, buttonX, buttonY);
if ( distance < radius/2 ) { //ボタンの中 if ( mousePressed ) { if ( mouseButton == LEFT ) { fill( 255, 0, 0 );//赤 } else { fill( 0, 0, 255 );//青 } } else { fill( 255, 255, 0 );//黄色 } } else { //ボタンの外 fill( 127 );//グレー }
//ボタンを描く ellipse( buttonX, buttonY, radius, radius ); }
0 notes
Text
Project 2: Transmutation (Where did I get my Idea?)
For the next project the theme is transmutation. The first question here to ask is what is transmutation? Well, to be honest, the only reason why I knew what the word ‘transmutation’ meant was because of FullMetal Alchemist and FullMetal Alchemist Brotherhood. If you could not tell, the show centers around alchemy, in particular what if alchemy was real? In alchemy, transmutation is a conversion of one state into another state. The easiest example of this being changing dirt or cheap metals into gold. (The show goes on a much deeper level than that but for the sake of this blog, a changing of states).
So, transmutation. What could I possibly do with transmutation? I played around with the idea of a face or animal changing into another species but for whatever reason, I was not happy with it. Maybe because the code (in theory) would be too easy. Something along the lines of, “as long as buttonX is not pressed, pictureX will remain the same. As soon as buttonX is pressed, pictureX changes.” Regardless, I was not happy with the idea.
Eventually, after taking a walk several days later I came up with the idea of an “Etch a Sketch.” Remember those red boxes when you were younger that when you turned one of two knobs the line of the screen would move? I thought to myself, “how cool would it be if I could make the arduino draw on processing using button or dials?”
One of my other inspirations for this particular project is my first processing project last semester which was a drawing program. Everyone enjoys a good drawing program because everyone is artistic in their own unique way. I enjoy the simplicity out of Microsoft paint and had a lot of fun with more complex programs such as Flash, Illustrator and Photoshop. Art programs bring out the child in us and that is my intention with this transmutation project. A changing of states is exciting, especially when we saw it for the first time in science classes. I think I want to bring back that magic. . . .
I knew physically it was possible after using the push buttons and potentiometer in class. To be sure, I did some quick research on the web to see if it was possible!
Here are my findings:
https://forum.processing.org/one/topic/making-a-drawing-machine-using-processing-and-an-arduino-help-with-serial-connection.html
This one being a forum with a user planning on using processing, servos and arduino! Not exactly what I was looking for, but the core code was there and there was potential.
Interestingly enough, after some searching I found something really promising.
http://codasign.com/tutorials/etch-a-sketch-project/
An actual step-by-step tutorial! Holy cow! I hit the jack-pot! I am using this tutorial currently, and adapting where I need to. So far, results have been mixed (and they will come soon!) My biggest issue (Adding the Button part) is that the button only works about 75% of the time. A good start I admit, but nonetheless having a button work 3 out of 4 times is not perfect. What does the button do? It is a clear button. Basically, the intention is that the arduino will be the ‘tools’ to draw, processing will be the ‘canvas’ and the mouse will be the ‘brush.’ Again, does not seem too hard and my results are promising so far. I am hopeful!
Stay tune as there is more to come!
0 notes
Link
Aloof free download PC game cracked with direct hyperlinks and torrents. Aloof is a puzzle fighter like Puyo Puyo Tetris, however the play is totally totally different. On this planet of Aloof, summon and defend small islands whereas constructing combos … Overview of the game Developer: ButtonX the publisher: ButtonX Release date: March 25, 2021 …
Aloof Read More »
0 notes