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
//DigiJoystick test and usage documentation #include "DigiJoystick.h" void setup() { pinMode(0, OUTPUT); pinMode(1, OUTPUT); } void loop() { // If not using plentiful DigiJoystick.delay() calls, make sure to //DigiJoystick.update(); // call this at least every 50ms // calling more often than that is fine // this will actually only send the data every once in a while unless the data is different // you can set the values from a raw byte array with: // char myBuf[8] = { // x, y, xrot, yrot, zrot, slider, // buttonLowByte, buttonHighByte // }; // DigiJoystick.setValues(myBuf); // Or we can also set values like this: DigiJoystick.setX((byte) 1); // scroll X left to right repeatedly DigiJoystick.setButtons((byte) 1, (byte) 1); digitalWrite(0, 1); digitalWrite(1, 1); // it's best to use DigiJoystick.delay() because it knows how to talk to // the connected computer - otherwise the USB link can crash with the // regular arduino delay() function DigiJoystick.delay(500); // wait 50 milliseconds DigiJoystick.setX((byte) 0); // scroll X left to right repeatedly DigiJoystick.setButtons((byte) 1, (byte) 0); digitalWrite(0, 0); digitalWrite(1, 0); }
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)