GithubHelp home page GithubHelp logo

pimoroni / skywriter-hat Goto Github PK

View Code? Open in Web Editor NEW
91.0 22.0 33.0 2.15 MB

Skywriter python libraries and examples

Home Page: https://shop.pimoroni.com/products/skywriter-hat

License: MIT License

C++ 4.55% Python 92.50% Makefile 0.10% Shell 2.17% CSS 0.33% HTML 0.34%
pypi-package

skywriter-hat's Introduction

Skywriter

This repository contains libraries and examples for the Pimoroni Skywriter boards.

Compatible with:

Installing Software

One-line Installer

We've created a super-easy installation script that will install all pre-requisites and get your HAT up and running in a jiffy. To run it fire up Terminal which you'll find in Menu -> Accessories -> Terminal on your Raspberry Pi desktop like so:

Finding the terminal

In the new terminal window type the following and follow the instructions:

curl -sS get.pimoroni.com/skywriter | bash

From PyPi (Stable)

Install smbus:

sudo apt install python3-smbus

Enable i2c:

sudo raspi-config nonint do_i2c 0

Install the library:

python3 -m pip install skywriter

From Source (Unstable/Latest)

Install smbus:

sudo apt install python3-smbus

Enable i2c:

sudo raspi-config nonint do_i2c 0

Install the library:

git clone https://github.com/pimoroni/skywriter-hat
cd skywriter-hat/python/library
python3 setup.py install

Documentation & Support

Skywriter to Pi Connection

You can use a full-sized Skywriter board with your Raspberry Pi and our library by mimicking the connections that the HAT users. They are as follows:

Skywriter Raspberry Pi
GND GND
TRFR GPIO 27
RESET GPIO 17
SCL GPIO 3 / SCL
SDA GPIO 2 / SDA
VCC 3V

skywriter-hat's People

Contributors

blujupiter32 avatar gadgetoid avatar loefberg avatar lowfatcode avatar reddog avatar roblan avatar roguem avatar sandyjmacdonald avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

skywriter-hat's Issues

Multiples Skywriters on one arduino board?

I see that the I2C address for the skywriter it's hardcoded SW_ADDR 0x42, would be possible assign different address to multiples Skywriter boards? therefore using only one Arduino to connect two or more skywriter boards?

Install script issues

I noticed a few issues when trying to setup the Skywriter HAT:

When running the install script on a clean install of the latest Raspbian Jessie (Lite) image (on a Pi 3 in my case), it appears to be running fine the first time.

  1. The install script appears to fail when trying to enable I2C.
    Manually enabling I2C through raspi-config works.
  2. When importing the skywriter Python library, a RPi.GPIO warning is shown regarding an already-in-use channel. Although this can be ignored using GPIO.setwarnings(False) as the library works fine, it's obviously not the best option.
  3. When re-running the install script, it fails on trying to install smbus.

AttributeError: 'AsyncWorker' object has no attribute 'isAlive'

Raspberry Pi Zero W
Raspberry Pi OS 11 (bullseye)
Python 3.9

This is the error I received when running the test.py example that comes with the full install of the Skywriter. I have fixed the issue by editing "/usr/lib/python3/dist-packages/skywriter.py" lines 93 & 98. See full error message below the solution.
Line 93: "if self.isAlive() == False:" to "if self.is_alive() == False:".
Line 98: "if self.isAlive() == True:" to "if self.is_alive() == True:".

Error message:
Traceback (most recent call last):
File "/home/pi/Pimoroni/skywriter/examples/test.py", line 2, in
import skywriter
File "/usr/lib/python3/dist-packages/skywriter.py", line 503, in
start_poll()
File "/usr/lib/python3/dist-packages/skywriter.py", line 358, in start_poll
worker.start()
File "/usr/lib/python3/dist-packages/skywriter.py", line 93, in start
if self.isAlive() == False:
AttributeError: 'AsyncWorker' object has no attribute 'isAlive'
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/skywriter.py", line 493, in _exit
stop_poll()
File "/usr/lib/python3/dist-packages/skywriter.py", line 362, in stop_poll
worker.stop()
File "/usr/lib/python3/dist-packages/skywriter.py", line 98, in stop
if self.isAlive() == True:
AttributeError: 'AsyncWorker' object has no attribute 'isAlive'

Hope this helps someone else.

deactivate auto-calibration

Hello,

Have you a method for deactivate the auto calibration on MGC3130 ?
I need detect a motionless body.

Thanks

Best regards

IOError: [Errno 2] No such file or directory - after running rpi-update

We've become aware of an issue with the new device-tree enabled kernel which requires i2c to be enabled in config.txt ( although I've been told this behaviour is being reverted so that i2c is enabled, but modules not inserted by default ).

If you're a regular uses of rpi-update, and you're seeing an error like this:

Traceback (most recent call last):
  File "test.py", line 2, in <module>
    import skywriter
  File "/usr/local/lib/python2.7/dist-packages/skywriter-0.0.2-py2.7.egg/skywriter.py", line 31, in <module>
    i2c = SMBus(i2c_bus_id())
IOError: [Errno 2] No such file or directory

Then please read this thread: http://www.raspberrypi.org/forums/viewtopic.php?f=28&t=97314

If you're here because you're seeing a similar error, but don't use rpi-update, then please try our installer script:

curl get.pimoroni.com/skywriter | bash

Exception("Skywriter encoutered nore than 10 consecutive I2C IO errors!")

Hi,
i've installed the new skywriter 3D and all works fine, but almost one or two times per day i've got this error and the script doesn't work anymore and the only way is to restart the script.
The error that appears is:

Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/local/lib/python2.7/dist-packages/skywriter.py", line 107, in run
if self.todo() == False:
File "/usr/local/lib/python2.7/dist-packages/skywriter.py", line 313, in _do_poll
raise Exception("Skywriter encoutered nore than 10 consecutive I2C IO errors!")

and the script is:

import skywriter
import signal

@SkyWriter.flick()
def flick(start,finish):
try:
print('Got a flick!', start, finish)
if start == "west":
print ("got west")

except:
print "ERROR"

signal.pause()

Skywriter hat cannot pick up on flicks - broken/not working?

I have recently purchased a skywriter hat and have followed all directions on installing scripts and inserting hat into GPIO pins. When I run test.py, the script does not pickup on flicks, and once, say, I touch the board, the touch is registered but then it continues to print touch even when I am not touching it. When I press control + C to cancel the script running, it continues to print out test.py. I am wondering if this is a programming error or something on the hardware side.

Installing bash script fails

Running the command, execute but fails because smbus dependency:

curl -sSL get.pimoroni.com/skywriter | bash

The raspberry pi has python versions 2.6 and 2.7 with 2.7 being the active one.

Relevant output:

Python 2 module found. Reinstall/Update? [y/N] y
Collecting skywriter
  Using cached skywriter-0.0.3.tar.gz
Collecting smbus (from skywriter)
  Could not find any downloads that satisfy the requirement smbus (from skywriter)
  No distributions at all found for smbus (from skywriter)
Python 2 library install failed!

Full output:

This script will install Skywriter libraries
and dependencies for both Python 2.

This process may take several minutes.

--- Warning ---

Always be careful when running scripts and commands
copied from the internet. Ensure they are from a
trusted source.

If you want to see what this script does before
running it, you should run:
    \curl -sS get.pimoroni.com/skywriter


Do you wish to continue? [y/N] y

Skywriter requires I2C, enable now? [y/N] y

I2C Already Enabled

Checking install requirements...

dpkg-query: no packages found matching python-pip
Updating package indexes...
Get:1 http://archive.mene.za.net wheezy Release.gpg [198 B]
Get:2 http://mirrordirector.raspbian.org wheezy Release.gpg [490 B]                                                       
Get:3 http://raspberrypi.collabora.com wheezy Release.gpg [836 B]                                                         
Get:4 http://vontaene.de . Release.gpg [198 B]                                                                            
Get:5 http://mirrordirector.raspbian.org wheezy Release [14.4 kB]                                                         
Hit http://vontaene.de . Release                                                  
Get:6 http://raspberrypi.collabora.com wheezy Release [7,511 B]                   
Hit http://archive.raspberrypi.org wheezy Release.gpg                             
Ign http://vontaene.de . Release                                                                                          
Get:7 http://raspberrypi.collabora.com wheezy/rpi armhf Packages [2,214 B]                                                
Get:8 http://mirrordirector.raspbian.org wheezy/main armhf Packages [6,894 kB]                                            
Hit http://archive.raspberrypi.org wheezy Release                                                                         
Get:9 http://archive.mene.za.net wheezy Release [4,463 B]                                                                 
Get:10 http://archive.mene.za.net wheezy/contrib armhf Packages [11.0 kB]                                                 
Hit http://archive.raspberrypi.org wheezy/main armhf Packages                                                             
Hit http://vontaene.de ./main armhf Packages                                                                              
Ign http://vontaene.de ./main Translation-en_GB                                                                           
Ign http://vontaene.de ./main Translation-en                                                                              
Ign http://raspberrypi.collabora.com wheezy/rpi Translation-en_GB                                                         
Ign http://raspberrypi.collabora.com wheezy/rpi Translation-en                                                            
Ign http://archive.mene.za.net wheezy/contrib Translation-en_GB                
Ign http://archive.mene.za.net wheezy/contrib Translation-en                   
Ign http://archive.raspberrypi.org wheezy/main Translation-en_GB                                                          
Ign http://archive.raspberrypi.org wheezy/main Translation-en                                                             
Hit http://mirrordirector.raspbian.org wheezy/contrib armhf Packages                                                      
Hit http://mirrordirector.raspbian.org wheezy/non-free armhf Packages                                                     
Hit http://mirrordirector.raspbian.org wheezy/rpi armhf Packages                                                          
Ign http://mirrordirector.raspbian.org wheezy/contrib Translation-en_GB                                                   
Ign http://mirrordirector.raspbian.org wheezy/contrib Translation-en                                                      
Ign http://mirrordirector.raspbian.org wheezy/main Translation-en_GB                                                      
Ign http://mirrordirector.raspbian.org wheezy/main Translation-en                                                         
Ign http://mirrordirector.raspbian.org wheezy/non-free Translation-en_GB                                                  
Ign http://mirrordirector.raspbian.org wheezy/non-free Translation-en                                                     
Ign http://mirrordirector.raspbian.org wheezy/rpi Translation-en_GB                                                       
Ign http://mirrordirector.raspbian.org wheezy/rpi Translation-en                                                          
Fetched 6,935 kB in 2min 29s (46.3 kB/s)                                                                                  
Reading package lists... Done
W: GPG error: http://vontaene.de . Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F0DAA5410C667A3E

Installing Skywriter requirements...
dpkg-query: no packages found matching python-pip

Checking for python-pip...
python-pip required. Installing.
Running sudo apt-get install python-pip

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  python2.6 python2.6-minimal
Suggested packages:
  python2.6-doc binfmt-support
Recommended packages:
  python-dev-all
The following NEW packages will be installed:
  python-pip python2.6 python2.6-minimal
0 upgraded, 3 newly installed, 0 to remove and 24 not upgraded.
Need to get 3,962 kB of archives.
After this operation, 13.2 MB of additional disk space will be used.
Get:1 http://mirrordirector.raspbian.org/raspbian/ wheezy/main python2.6-minimal armhf 2.6.8-1.1 [1,409 kB]
Get:2 http://mirrordirector.raspbian.org/raspbian/ wheezy/main python2.6 armhf 2.6.8-1.1 [2,442 kB]                       
Get:3 http://mirrordirector.raspbian.org/raspbian/ wheezy/main python-pip all 1.1-3 [112 kB]                              
Fetched 3,962 kB in 38s (103 kB/s)                                                                                        
Selecting previously unselected package python2.6-minimal.
(Reading database ... 78209 files and directories currently installed.)
Unpacking python2.6-minimal (from .../python2.6-minimal_2.6.8-1.1_armhf.deb) ...
Selecting previously unselected package python2.6.
Unpacking python2.6 (from .../python2.6_2.6.8-1.1_armhf.deb) ...
Selecting previously unselected package python-pip.
Unpacking python-pip (from .../python-pip_1.1-3_all.deb) ...
Processing triggers for man-db ...
Processing triggers for desktop-file-utils ...
Processing triggers for menu ...
Setting up python2.6-minimal (2.6.8-1.1) ...
Linking and byte-compiling packages for runtime python2.6...
Setting up python2.6 (2.6.8-1.1) ...
Setting up python-pip (1.1-3) ...
Processing triggers for python-support ...
Processing triggers for menu ...



Checking for python-dev...
python-dev already installed.


Checking for Python 2 library...

Found!

Python 2 module found. Reinstall/Update? [y/N] y
Collecting skywriter
  Using cached skywriter-0.0.3.tar.gz
Collecting smbus (from skywriter)
  Could not find any downloads that satisfy the requirement smbus (from skywriter)
  No distributions at all found for smbus (from skywriter)
Python 2 library install failed!

Reset not always HIGH?

Please enable internal pull-up for reset pin on Arduino when Skywriter is being initialized. Sometimes on start-up, sensor is "frozen", that is, it doesn't work until next reset. I've found out that enabling internal pull-up resistor on Arduino solves the issue, but I'm not sure why.

Change line 14 in skywriter.cpp from:
pinMode(this->rst, INPUT);
to:
pinMode(this->rst, INPUT_PULLUP);

device (XL) stopped working

Hi!

I used the hat on an teensy LC and it worked just fine.

suddenly it stopped. Didn't change anything in de code... no other simple example code can interface with de device... i2c scanner still finds it. but rest is frozen.

#include <Wire.h>
#include <skywriter.h>

unsigned int max_x, max_y, max_z;
unsigned int min_x, min_y, min_z;

void setup() {
  Serial.begin(9600);
  while(!Serial){};
  Serial.println("Hello World!");

//  pinMode(9, INPUT_PULLUP);


  Skywriter.begin(0, 1);
//  Skywriter.onXYZ(handle_xyz);
//  Skywriter.onTouch(touch);
  Skywriter.onAirwheel(airwheel);
  Skywriter.onGesture(gesture);
}

void loop() {
  Skywriter.poll();
  // Analog Joy

//  Joystick.X(analogRead(7));
//  Joystick.Y(analogRead(6));
//  Serial.print(analogRead(7));
//  Serial.print('\n');
//  Serial.print(analogRead(6));
//  Serial.print('\n');
  
//  Joystick.button(2, !digitalRead(9));
}

void handle_xyz(unsigned int x, unsigned int y, unsigned int z){
 if (x < min_x) min_x = x;
 if (y < min_y) min_y = y;
 if (z < min_z) min_z = z;
 if (x > max_x) max_x = x;
 if (y > max_y) max_y = y;
 if (z > max_z) max_z = z;
 char buf[17];
 sprintf(buf, "%05u:%05u:%05u", x, y, z);
 Serial.println(buf);
 x = map(x, 0, 65535, 0, 1023);
 y = map(y, 0, 65535, 0, 1023);
 z = map(z, 0, 65535, 0, 1023);
 Joystick.X(x);
 Joystick.Y(y);
 Joystick.Z(z);

}




void airwheel(int delta){
  Serial.println("Got airwheel ");
  Serial.print(delta);
  Serial.print('\n');

  Mouse.scroll(delta / 11);
  

}

void gesture(unsigned char type){
  Serial.println("Got gesture ");
  Serial.print(type,DEC);
  Serial.print('\n');
  
  if( type == SW_FLICK_WEST_EAST ){
     //Mouse.scroll(0, 3);
     Joystick.hat(90);
     delay(200);

  }
  if( type == SW_FLICK_EAST_WEST ){
     //Mouse.scroll(0, -3);
     Joystick.hat(270);
     delay(250);

  }
  if( type == SW_FLICK_SOUTH_NORTH ){
    // Mouse.scroll(-3, 0);
     Joystick.hat(0);
     delay(250);
 
  }
  if( type == SW_FLICK_NORTH_SOUTH ){
     //Mouse.scroll(3, 0);
     Joystick.hat(180);
     delay(250);

  }
  else {
    Joystick.hat(-1);
  }
  delay(50);
}

"Airwheel" gesture never activates

I've got a Skywriter HAT attached to a Pi 4. All other gestures seem to work fine, but airwheel specifically never gets any callbacks. Even a simple callback like the below never gets called:

import signal
import skywriter

@skywriter.airwheel()
def f(delta): print(delta)

signal.pause()

I've tried distances of anywhere from barely above the surface to about 15cm above the surface โ€” nothing seems to register.

smbus dependency not found

When you run setup.py the install fails as it can not find a package/link for smbus:

running install
Checking .pth file support in /usr/local/lib/python2.7/dist-packages/
/usr/bin/python -E -c pass
TEST PASSED: /usr/local/lib/python2.7/dist-packages/ appears to support .pth files
running bdist_egg
running egg_info
creating skywriter.egg-info
writing requirements to skywriter.egg-info/requires.txt
writing skywriter.egg-info/PKG-INFO
writing top-level names to skywriter.egg-info/top_level.txt
writing dependency_links to skywriter.egg-info/dependency_links.txt
writing manifest file 'skywriter.egg-info/SOURCES.txt'
reading manifest file 'skywriter.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'skywriter.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-armv6l/egg
running install_lib
running build_py
creating build
creating build/lib.linux-armv6l-2.7
copying skywriter.py -> build/lib.linux-armv6l-2.7
creating build/bdist.linux-armv6l
creating build/bdist.linux-armv6l/egg
copying build/lib.linux-armv6l-2.7/skywriter.py -> build/bdist.linux-armv6l/egg
byte-compiling build/bdist.linux-armv6l/egg/skywriter.py to skywriter.pyc
creating build/bdist.linux-armv6l/egg/EGG-INFO
copying skywriter.egg-info/PKG-INFO -> build/bdist.linux-armv6l/egg/EGG-INFO
copying skywriter.egg-info/SOURCES.txt -> build/bdist.linux-armv6l/egg/EGG-INFO
copying skywriter.egg-info/dependency_links.txt -> build/bdist.linux-armv6l/egg/EGG-INFO
copying skywriter.egg-info/requires.txt -> build/bdist.linux-armv6l/egg/EGG-INFO
copying skywriter.egg-info/top_level.txt -> build/bdist.linux-armv6l/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist/skywriter-0.0.2-py2.7.egg' and adding 'build/bdist.linux-armv6l/egg' to it
removing 'build/bdist.linux-armv6l/egg' (and everything under it)
Processing skywriter-0.0.2-py2.7.egg
creating /usr/local/lib/python2.7/dist-packages/skywriter-0.0.2-py2.7.egg
Extracting skywriter-0.0.2-py2.7.egg to /usr/local/lib/python2.7/dist-packages
Adding skywriter 0.0.2 to easy-install.pth file

Installed /usr/local/lib/python2.7/dist-packages/skywriter-0.0.2-py2.7.egg
Processing dependencies for skywriter==0.0.2
Searching for smbus
Reading http://pypi.python.org/simple/smbus/
Couldn't find index page for 'smbus' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
No local packages or download links found for smbus
error: Could not find suitable distribution for Requirement.parse('smbus')

SW_CIRCLE_C(C)LOCKWISE gesture

I cannot get SW_CIRCLE_CLOCKWISE and SW_CIRCLE_CCLOCKWISE working, when are these supposed to be activated (what gesture) and are these triggered by void gesture(unsigned char type) or by another function?

Also the documentation on the Arduino library and examples is very scarce, it could use an update.

worker.stop() AttributeError: 'NoneType' object has no attribute 'stop'

I get this error after running test.py (sudo python test.py):
Traceback (most recent call last): File "umouse.py", line 2, in <module> import skywriter File "/usr/lib/python2.7/dist-packages/skywriter.py", line 502, in <module> i2c.write_i2c_block_data(SW_ADDR, 0xa1, [0b00000000, 0b00011111, 0b00000000, 0b00011111]) IOError: [Errno 121] Remote I/O error Error in atexit._run_exitfuncs: Traceback (most recent call last): File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs func(*targs, **kargs) File "/usr/lib/python2.7/dist-packages/skywriter.py", line 493, in _exit stop_poll() TypeError: 'NoneType' object is not callable Error in sys.exitfunc: Traceback (most recent call last): File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs func(*targs, **kargs) File "/usr/lib/python2.7/dist-packages/skywriter.py", line 493, in _exit stop_poll() TypeError: 'NoneType' object is not callable
Can anyone help me resolve this issue?

i2c detect -y 2 gives me:
0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- 3a -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: 50 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- --
and the others all produce a blank report.
Thank You.

garbage gesture

So in the documentation it says there is a garbage gesture but the wording of how that gesture is performed doesn't really clarify how to actually make this gesture. I'm working on turning a pi into a gesture based hotkey machine and that one could prove useful for closing windows or opening a terminal. But for the life of me I can't figure out how it's performed. It's in the library but there are no code examples of it. Is it not finished? And I have just been waving like a mad man for no reason?

examples/test.py just prints firmware info

I've enabled i2c and installed the library, but when I try to run the example program all that happens is that it prints the firmware info, over and over again until i ctrl-c out of it.

If I move my hand over or tap the sensor nothing happens, except the same stream of firmware info.

Got firmware info
1.1.18;p:Hills
Got firmware info
1.1.18;p:Hills
Got firmware info
1.1.18;p:Hills

Problem runnning test.py

I installed the library successfully on a RPI 2, fresh installed Raspbian (updated everything) and after a reboot:

pi@raspberrypi:~/Pimoroni/skywriter $ sudo ./test.py
Traceback (most recent call last):
File "./test.py", line 2, in
import skywriter
File "/usr/local/lib/python2.7/dist-packages/skywriter.py", line 482, in
i2c.write_i2c_block_data(SW_ADDR, 0xa1, [0b00000000, 0b00011111, 0b00000000, 0b00011111])
IOError: [Errno 5] Input/output error
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
func(_targs, *_kargs)
File "/usr/local/lib/python2.7/dist-packages/skywriter.py", line 473, in _exit
stop_poll()
TypeError: 'NoneType' object is not callable
Error in sys.exitfunc:
Traceback (most recent call last):
File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
func(_targs, *_kargs)
File "/usr/local/lib/python2.7/dist-packages/skywriter.py", line 473, in _exit
stop_poll()
TypeError: 'NoneType' object is not callable

Any idea?

Autopy not installed

With the get installer, it looks like autopy, required for the keyboard and mouse examples, isn't installed. Further, trying to pip install autopy seems to fail also on the most recent version of Jessie.

mqtt

hello

I was wondering if the software of this device can be connected to a MQTT broker and send the data to other devices via MQTT?

thanks.

Skywriter XL XYZ positions inaccurate

I have an issue with my SkyWriter XL, using the latest RPi library and having updated to the latest firmware, I am finding that the XYZ coordinates returned by the move reports are highly inaccurate and inconsistent.

For example:

  • in the Horizontal (X) axis, the values I get back range from about 0.25 at the extreme left hand side to 1.0, but it reaches 1.0 when my finger is barely half way across the sensor.
  • in the vertical (Y) axis, it stays at 0.0 until my finger is about a quarter of the way up from the bottom and never goes above 0.75
  • the Z axis, by contrast, seems to be about correct

Is this behaviour normal for the XL, or is there a problem with my device?

Multiple detection onTouch

When using onTouch my arduino seems to be detecting multiple taps even when I tap once. And when I double tap it will detect a tap first and then a double tap. I am using the Flick Large with an Elegoo Uno R3. Any help would be much appreciated :)

void setup() {
  Serial.begin(9600);
  while(!Serial){};

  Serial.println("Hello world!");

  Skywriter.begin(10,11);

  Skywriter.onAirwheel(handleAirwheel);
  Skywriter.onGesture(handleGesture);
  Skywriter.onTouch(handleTouch);
//  Skywriter.onXYZ(xyz);

  pinMode (9, OUTPUT);
  pinMode (8, OUTPUT);

  digitalWrite(9, HIGH);
  digitalWrite(8, HIGH);
    
}

void loop() {
  Skywriter.poll();
}
void handleTouch(unsigned char type){
  if( type == SW_TOUCH_CENTER ){
     Serial.println("Centre touch");
  }

  if(type == SW_DOUBLETAP_CENTER){
    Serial.println("double tap");
  }
}

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.