Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
#include
#include
#include
#include
#define XACCEL_MIN 0.2 // Min range of X axis acceleration, wont move below #define YACCEL_MIN 0.2 // Min range of Y axis acceleration, wont move below #define XThreshold 3.0 //the sensor is noisy, ignore slight variations #define YThreshold 3.0 #define ZThreshold 3.0 #define XSCREENSIZE 1280 #define YSCREENSIZE 780 float x=0.0; float y=0.0; float z=0.0; void setup() { CircuitPlayground.begin(); Mouse.begin(); Serial.begin(9600); } void loop() { // Check if the slide switch is enabled (on +) and if not then just exit out if (!CircuitPlayground.slideSwitch()) { return; } boolean left_first = CircuitPlayground.leftButton(); //ok, we need resting position to be center of screen. float x1 = CircuitPlayground.motionX(); float y1 = CircuitPlayground.motionY(); float z1 = CircuitPlayground.motionZ(); //if(z1) //now got think about this oh no... Serial.print("X: "); Serial.print(x); Serial.print(" Y: "); Serial.print(y); Serial.print(" Z: "); Serial.print(z); Serial.println(); //move mouse to center }
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)