Description
Allows the validation and recognition of the gesture of unfastening a button.
[/spb_text_block] [spb_text_block pb_margin_bottom=»no» pb_border_bottom=»no» width=»1/1″ el_position=»first last»]Syntax
[/spb_text_block] [codesnippet pb_margin_bottom=»yes» width=»1/2″ el_position=»first last»]unfastenButton()
[/codesnippet] [spb_text_block pb_margin_bottom=»no» pb_border_bottom=»no» width=»1/1″ el_position=»first last»]Parameters
None.
[/spb_text_block] [spb_text_block pb_margin_bottom=»no» pb_border_bottom=»no» width=»1/1″ el_position=»first last»]Returns
[/spb_text_block] [codesnippet pb_margin_bottom=»yes» width=»1/2″ el_position=»first last»]true //if recognizes the gesture of unfastening the button.
[/codesnippet] [spb_text_block pb_margin_bottom=»no» pb_border_bottom=»no» width=»1/1″ el_position=»first last»]Example code
Simple blink.
[/spb_text_block] [codesnippet pb_margin_bottom=»yes» width=»1/1″ el_position=»first last»]#include <Soft2Soft.h>
Button button(2)
int ledPin=3;
void setup() {
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
}
void loop() {
if(button.fastenButton())digitalWrite(ledPin,HIGH);//turns on the led if the button is fastened
delay(500);
fi(button.unfastenButton()digitalWrite(ledPin,LOW);//turns off the led if the button is unfastened
delay(500);
}
Crafting Examples
Button gestures
Textile gestures sampler
Jacket
[/spb_text_block] [blank_spacer height=»30px» width=»1/3″ el_position=»first»] [spb_text_block pb_margin_bottom=»no» pb_border_bottom=»no» width=»1/3″]
[sf_button colour=»grey» type=»stroke-to-fill» size=»standard» link=»http://lauracortes-002-site8.btempurl.com/soft2soft-biblioteca-gestos-textiles/» target=»_self» icon=»ss-doc» dropshadow=»no» extraclass=»»]Back to Reference[/sf_button]
[/spb_text_block] [blank_spacer height=»30px» width=»1/3″ el_position=»last»]