<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Flick Large gesture control]]></title><description><![CDATA[<p dir="auto">Hello all,</p>
<p dir="auto">I have tried to use the flick Large sensor together with my Raspberry Pi 2 to control the interface of the MagicMirror, as I have made some pages and wanted to scroll through them.</p>
<p dir="auto">What I have managed to do is to control MMM-pages, MMM-page-indicator and the default news module via my MMM-flick module.</p>
<p dir="auto">The controls are as follows:</p>
<p dir="auto">Swipe Left - Decrement Page<br />
Swipe Right - Increment Page<br />
Swipe Up - Show news description<br />
Swipe Up again - Open News page<br />
Swipe Up as the news page is opened - Scroll down the news page<br />
Swipe Down - Close News Page<br />
Swipe Down again - Close News Description</p>
<p dir="auto">I`m currently working on implementing the touch functionality. I want to also have mouse control.</p>
<p dir="auto">The code is not perfect, I`m working it.</p>
<p dir="auto">Here is the code (note that I have changed some libraries for it to work with the ASUS Tinker Board, as far as I know I`m the only one who has working flicklibs on the TinkerBoard. If someone is interested in getting the flick sensor to work with the TinkerBoard pm me ):</p>
<p dir="auto"><a href="http://MMM-flick.py" target="_blank" rel="noopener noreferrer nofollow ugc">MMM-flick.py</a> - used to read sensor data</p>
<pre><code> #!/usr/bin/env python
 
 import sys
 
 import json
 
 import time
 
 import signal
 
 import flicklib
 
 import RPi.GPIO as GPIO
 
 #import autopy
 
 
 
 GPIO.setmode(GPIO.BOARD)
 
 GPIO.setup(15, GPIO.OUT) 
 
 GPIO.setup(7, GPIO.OUT)
 
 
 
 #Turn on both LEDs for orange color in Stand By
 
 #GPIO.output(7, True) # Turn on RED LED
 
 #GPIO.output(15, True)# Turn on GREEN LED
 
 
 
 
 
 #Airwheel data
 
 
 
 some_value = 5000
 

 
 last_airwheel = 0
 
 delay = 5000
 
 
 
 
 
 #Get display size
 
 
 
 #width, height = autopy.screen.get_size()
 
 
 
 def to_node(type, message):
 
 	# convert to json and print (node helper will read from stdout)
 
 	try:
 
 		print(json.dumps({type: message}))
 
 	except Exception:
 
 		pass
 
 	# stdout has to be flushed manually to prevent delays in the node helper communication
 
 	sys.stdout.flush()
 
 
 
 to_node("status", 'Flick has started...')
 
 
 
 @flicklib.flick()
 
 def flick(start,finish):
 
   
 
 	#Slide down the newsfeed (DOWN GESTURE)
 
 	if(start == "north" and finish == "south"):
 
 		to_node("gesture", "ARTICLE_LESS_DETAILS")
 
 		GPIO.output(7, True)
 
 		time.sleep(0.5)
 
 		GPIO.output(7, False)
 
 		
 
 	#Slide up the newsfeed (UP GESTURE)
 
 	elif(start == "south" and finish == "north"):
 
 		to_node("gesture", "ARTICLE_MORE_DETAILS")
 
 		GPIO.output(15, True)
 
 		time.sleep(0.5)
 
 		GPIO.output(15, False)
 
 		
 
 	#Next page (RIGHT GESTURE)
 
 	elif(start == "west" and finish == "east"):
 
 		to_node("gesture", "PAGE_DECREMENT")
 
 		GPIO.output(7, True)
 
 		time.sleep(0.5)
 
 		GPIO.output(7, False)
 
 		
 
   
 
 	#Previous page (LEFT GESTURE)
 
 	elif(start == "east" and finish == "west"):
 
 		to_node("gesture", "PAGE_INCREMENT")
 
 		GPIO.output(15, True)
 
 		time.sleep(0.5)
 
 		GPIO.output(15, False)
 
    
 
 @flicklib.airwheel()
 
 def spinny(delta):
 
 	global some_value
 
 	global last_airwheel
 
 	global delay
 
 	some_value += delta
 
 	if some_value &lt; 0:
 
 		some_value = 0
 
 	if some_value &gt; 10000:
 
 		some_value = 10000
 
 	now = int(round(time.time() * 1000))
 
 	if(now - last_airwheel &gt; delay):
 
 		#to_node()
 
 		last_airwheel = now
 
 
 
 #Mouse control via flick board
 
 
 
 #@flicklib.move()
 
 #def move(x,y,z):
 
 #	x = (x) * width
 
 #	y = (y) * height
 
 
 
 #	x = int(x)
 
 #	y = height - int (y)
 
 	
 
 #	if( y &gt; 799 ):
 
 #		y = 799
 
 
 
 	#autopy.mouse.move(x, y)
 
 
 
 #Double tap gesture 
 
 
 
 #@flicklib.double_tap()
 
 #def doubletap(position):
 
 	#
 
 
 
 #Tap gesture
 
 
 
 @flicklib.tap()
 
 def tap(position):
 
 	if position == 'center':
 
 		GPIO.output(15, True)# Turn on GREEN LED
 
 		time.sleep(0.5)
 
 		GPIO.output(15, False)# Turn off GREEN LED
 
 
 
 #Touch gesture
 
 
 
 #@flicklib.touch()
 
 #def touch(position):
 
 	#
 
 
 
 
 
 
 
 signal.pause() 
</code></pre>
<p dir="auto">node_helper.js</p>
<pre><code> 'use strict';
 
 
 
 const NodeHelper = require('node_helper');
 
 const {PythonShell} = require('python-shell');
 
 var pythonStarted = false
 
 
 
 module.exports = NodeHelper.create({
 
   
 
 	python_start: function () {
 
 		const self = this;
 
 		const pyshell = new PythonShell('modules/' + this.name + '/MMM-flick.py', { mode: 'json', args: [JSON.stringify(this.config)]});
 
 		
 
 		pyshell.on('message', function (message) {
 
       
 
 			if (message.hasOwnProperty('status')){
 
 			console.log("node_helper_[" + self.name + "]" + message.status);
 
 			}
 
 			
 
 			if (message.hasOwnProperty('gesture')){
 
 			console.log("node_helper_[" + self.name + "] " + message.gesture);
 
 			self.sendSocketNotification("gesture_observed", message.gesture);
 
 			}
 
 		});
 
 		
 
 		 pyshell.end(function (err) {
 
 			if (err) throw err;
 
 			console.log("node_helper_[" + self.name + "] " + 'finished running...');
 
 		});
 
 	},
 
 
 
 	// Subclass socketNotificationReceived received.
 
 	socketNotificationReceived: function(notification, payload) {
 
 		if(notification === 'CONFIG') {
 
 		  this.config = payload
 
 		  if(!pythonStarted) {
 
 			pythonStarted = true;
 
 			this.python_start();
 
 		  };
 
 		};
 
 	}
 
 	
 
 });
</code></pre>
<p dir="auto">MMM-flick.js</p>
<pre><code>Module.register("MMM-flick",{	

		gesture_up: 0,

		gesture_right: 0,	

	// Override socket notification handler.

	socketNotificationReceived: function(notification, payload) {

		if (notification === "gesture_observed"){

			const self = this;

			self.sendNotification(payload);

			if (payload === "up"){

					MM.getModules().withClass(this.config.defaultClass).exceptWithClass(this.config.everyoneClass).enumerate(function(module) {

						module.hide(1000, function() {

							Log.log(module.name + ' is hidden.');

						});

					});

			

					MM.getModules().withClass("class_up_1_show").enumerate(function(module) {

						module.show(1000, function() {

							Log.log(module.name + ' is shown.');

						});

					});

			}

			else if (payload === "down") {

				MM.getModules().withClass("class_up_1_show").enumerate(function(module) {

						module.hide(1000, function() {

							Log.log(module.name + ' is hidden by gesture.');

						});

					});

			}

		}

	},

	

	start: function() {

		this.current_user = null;

		this.sendSocketNotification('CONFIG', this.config);

		Log.info('Starting module: ' + this.name);

	}

	

});
</code></pre>
]]></description><link>https://forum.magicmirror.builders/topic/8907/flick-large-gesture-control</link><generator>RSS for Node</generator><lastBuildDate>Thu, 13 Aug 2026 18:06:39 GMT</lastBuildDate><atom:link href="https://forum.magicmirror.builders/topic/8907.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 12 Oct 2018 17:40:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Flick Large gesture control on Fri, 24 Jun 2022 21:54:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/radu_stancu" aria-label="Profile: Radu_Stancu">@<bdi>Radu_Stancu</bdi></a> I would really like to have a copy of your module. I’ve been working with the code you posted at the beginning of this topic thread and I’ve gotten tap added. But the wheel just crashes my flick. I’m building a mirror for my Dad and I’d like to surprise him with one he can control with the flick. It would really impress him.</p>
<p dir="auto">I hope you are still checking in on this magicmirror builders forum.</p>
]]></description><link>https://forum.magicmirror.builders/post/102445</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/102445</guid><dc:creator><![CDATA[kayakbabe]]></dc:creator><pubDate>Fri, 24 Jun 2022 21:54:23 GMT</pubDate></item><item><title><![CDATA[Reply to Flick Large gesture control on Tue, 11 Jun 2019 20:27:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/radu_stancu" aria-label="Profile: Radu_Stancu">@<bdi>Radu_Stancu</bdi></a> very interesting ! ok thank you</p>
]]></description><link>https://forum.magicmirror.builders/post/57865</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/57865</guid><dc:creator><![CDATA[xne0n]]></dc:creator><pubDate>Tue, 11 Jun 2019 20:27:09 GMT</pubDate></item><item><title><![CDATA[Reply to Flick Large gesture control on Sat, 08 Jun 2019 12:39:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/xne0n" aria-label="Profile: xne0n">@<bdi>xne0n</bdi></a>, I have made some progress, it runs perfectly smooth on the Asus Tinker board, I have managed to get mouse input working decently. It works by putting your finger close to the flick, the orange led turns on, and then the mouse follows your finger. It is not mouse pad like precision, but it gets the job done. I will update the source code, or maybe add it as a module on github after I finish writing my thesis.</p>
]]></description><link>https://forum.magicmirror.builders/post/57770</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/57770</guid><dc:creator><![CDATA[Radu_Stancu]]></dc:creator><pubDate>Sat, 08 Jun 2019 12:39:28 GMT</pubDate></item><item><title><![CDATA[Reply to Flick Large gesture control on Fri, 31 May 2019 16:08:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/radu_stancu" aria-label="Profile: Radu_Stancu">@<bdi>Radu_Stancu</bdi></a><br />
Hi,</p>
<p dir="auto">Did you make some progress in your work, and so can you share it, I’d be glad to help with the module</p>
<p dir="auto">Thanks</p>
]]></description><link>https://forum.magicmirror.builders/post/57608</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/57608</guid><dc:creator><![CDATA[xne0n]]></dc:creator><pubDate>Fri, 31 May 2019 16:08:43 GMT</pubDate></item><item><title><![CDATA[Reply to Flick Large gesture control on Sun, 12 May 2019 09:59:41 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">Sorry for my really late reply, I have been working on the module for a while, getting the mouse control to work.</p>
<p dir="auto">As for your request, I did not know of the MMM-GroveGestures module. I had a look at it and the basic commands are basically the same although the code is written a bit differently. The gestures sequence though is a nice feature and I will look into that and try to do it the following days, but I am not really sure what actions should I bind to those new gestures.</p>
<p dir="auto">Best regards,</p>
<p dir="auto">Radu</p>
]]></description><link>https://forum.magicmirror.builders/post/56960</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/56960</guid><dc:creator><![CDATA[Radu_Stancu]]></dc:creator><pubDate>Sun, 12 May 2019 09:59:41 GMT</pubDate></item><item><title><![CDATA[Reply to Flick Large gesture control on Mon, 11 Mar 2019 10:24:21 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/radu_stancu" aria-label="Profile: Radu_Stancu">@<bdi>Radu_Stancu</bdi></a><br />
Hi,</p>
<p dir="auto">Did you considered using (and maybe tweaking a bit) the MMM-GroveGestures module and “only” replace the Grove Gesture Sensor (PAJ7620u2) by the Flick one?</p>
<p dir="auto">It’s maybe a bit “basic thinking” from me but the MMM-GroveGestures plugin is really working great and both sensor seems to be based on the same working method / supplier / …<br />
So maybe worth to consider it, don’t you think?</p>
<p dir="auto">(would eb great for me at least, as I’m using MMM-GroveGestures and I’m interested into switching to the flick one).</p>
<p dir="auto">Regards</p>
]]></description><link>https://forum.magicmirror.builders/post/54069</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/54069</guid><dc:creator><![CDATA[bolish]]></dc:creator><pubDate>Mon, 11 Mar 2019 10:24:21 GMT</pubDate></item><item><title><![CDATA[Reply to Flick Large gesture control on Thu, 31 Jan 2019 13:08:11 GMT]]></title><description><![CDATA[<p dir="auto">So you did you get it to work? I have an updated version if you are interested.</p>
]]></description><link>https://forum.magicmirror.builders/post/51172</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/51172</guid><dc:creator><![CDATA[Radu_Stancu]]></dc:creator><pubDate>Thu, 31 Jan 2019 13:08:11 GMT</pubDate></item><item><title><![CDATA[Reply to Flick Large gesture control on Wed, 30 Jan 2019 23:24:47 GMT]]></title><description><![CDATA[<p dir="auto">I sorted it out. Didn’t have python-shell installed :)</p>
]]></description><link>https://forum.magicmirror.builders/post/51152</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/51152</guid><dc:creator><![CDATA[Frek]]></dc:creator><pubDate>Wed, 30 Jan 2019 23:24:47 GMT</pubDate></item><item><title><![CDATA[Reply to Flick Large gesture control on Wed, 30 Jan 2019 00:52:42 GMT]]></title><description><![CDATA[<p dir="auto">This is exactly what Im looking for. Im trying to get your module to run but Im first of all not a programmer (can do simple things in python an such)</p>
<p dir="auto">I altered your python script to work with my skywriter board, easy enough. But i wonder how i set up the config file? Just load the module? If I do that I get a error that says "cannot find module “python-shell”</p>
<p dir="auto">I was hoping the sensor would work behind the mirror to but it wont. I will put it on the inside of the frame insted…</p>
]]></description><link>https://forum.magicmirror.builders/post/51106</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/51106</guid><dc:creator><![CDATA[Frek]]></dc:creator><pubDate>Wed, 30 Jan 2019 00:52:42 GMT</pubDate></item><item><title><![CDATA[Reply to Flick Large gesture control on Sat, 08 Dec 2018 10:29:29 GMT]]></title><description><![CDATA[<p dir="auto">Updated the code, and also support for the Asus Tinker Board.</p>
]]></description><link>https://forum.magicmirror.builders/post/47859</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/47859</guid><dc:creator><![CDATA[Radu_Stancu]]></dc:creator><pubDate>Sat, 08 Dec 2018 10:29:29 GMT</pubDate></item><item><title><![CDATA[Reply to Flick Large gesture control on Tue, 27 Nov 2018 12:10:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/steffenschmidt" aria-label="Profile: steffenschmidt">@<bdi>steffenschmidt</bdi></a>, I was successful to some extent. I have managed to use the gestures from the board to control the interface. Up, down, left and right are working and more will follow when I know what I want them to do. The only problem is that the flick sensor is NOT WORKING behind the mirror, probably because of the aluminum/silver layer that makes a mirror a mirror.</p>
<p dir="auto">I will work on the project in the winter holidays and post some more details.</p>
]]></description><link>https://forum.magicmirror.builders/post/47405</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/47405</guid><dc:creator><![CDATA[Radu_Stancu]]></dc:creator><pubDate>Tue, 27 Nov 2018 12:10:53 GMT</pubDate></item><item><title><![CDATA[Reply to Flick Large gesture control on Thu, 15 Nov 2018 16:52:38 GMT]]></title><description><![CDATA[<p dir="auto">Could you describe, if you were successfull with the implementation of the board? Best Regards.</p>
]]></description><link>https://forum.magicmirror.builders/post/46811</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/46811</guid><dc:creator><![CDATA[SteffenSchmidt]]></dc:creator><pubDate>Thu, 15 Nov 2018 16:52:38 GMT</pubDate></item><item><title><![CDATA[Reply to Flick Large gesture control on Tue, 16 Oct 2018 10:41:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/radu_stancu" aria-label="Profile: radu_stancu">@<bdi>radu_stancu</bdi></a> Thank you for your answer I look forward to your feedback, because I would also like to use this solution. 🙂</p>
]]></description><link>https://forum.magicmirror.builders/post/45484</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/45484</guid><dc:creator><![CDATA[macnice]]></dc:creator><pubDate>Tue, 16 Oct 2018 10:41:09 GMT</pubDate></item><item><title><![CDATA[Reply to Flick Large gesture control on Sun, 14 Oct 2018 20:06:50 GMT]]></title><description><![CDATA[<p dir="auto">That is exactly what I’m planning to do. In theory it works behind the mirror, but you will lose the touch gestures more  than likely. Unfortunately I do not have the mirror yet (it has not been delivered yet), but I’ll post a picture/results when I get it.</p>
<p dir="auto">So far I wrote the code this way:</p>
<p dir="auto">Left/right swipes go through MMM-pages &amp; MMM-pages_indicator</p>
<p dir="auto">Up/down swipes open/close newsfeed details</p>
<p dir="auto">Each gesture also triggers the LED on the sensor board.</p>
<p dir="auto">I’m still thinking what other things I can do with the remaining gestures.</p>
<p dir="auto">I’ll update the correct code after I clean it up a bit.</p>
]]></description><link>https://forum.magicmirror.builders/post/45409</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/45409</guid><dc:creator><![CDATA[Radu_Stancu]]></dc:creator><pubDate>Sun, 14 Oct 2018 20:06:50 GMT</pubDate></item><item><title><![CDATA[Reply to Flick Large gesture control on Sun, 14 Oct 2018 14:24:30 GMT]]></title><description><![CDATA[<p dir="auto">Hello, is it possible to place it behind the mirror? Could you show us a picture of your integration into MagicMirror?<br />
Thank you in advance.</p>
]]></description><link>https://forum.magicmirror.builders/post/45392</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/45392</guid><dc:creator><![CDATA[macnice]]></dc:creator><pubDate>Sun, 14 Oct 2018 14:24:30 GMT</pubDate></item><item><title><![CDATA[Reply to Flick Large gesture control on Sun, 14 Oct 2018 14:03:40 GMT]]></title><description><![CDATA[<p dir="auto">Nvm, I got it working perfectly! xD</p>
]]></description><link>https://forum.magicmirror.builders/post/45391</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/45391</guid><dc:creator><![CDATA[Radu_Stancu]]></dc:creator><pubDate>Sun, 14 Oct 2018 14:03:40 GMT</pubDate></item></channel></rss>