Jump to content

[Version 1] Arduino Library Switches And Tfmanlib

Recommended Posts

Hi all I just wanted to let you know I released my code for automating dip and button switches.

Called switches.h

and my own personal library's for the ducky project.

Called tfmanlib.h


Please use the example switches.pde, I made a good rick roller and gender bender for facebook.com

as well as some file copying and random keystroker. All make use of switches and tfmanlib as well they assume

you have a 6 - 16 dip switch, as well as a button switch,

Please look through the first 2 pages and change any pin assignments necessary to compile for your teensy hardware.

Thanks again for all the help in these forums look foreword to hear from anyone that could make use of these


Link to comment
Share on other sites

  • 2 months later...

Just would like to post that my librarys have been updated and are found at


there are a few fixes and some new functions pleas see the example switches.pde


#if defined(CORE_TEENSY)

#if defined(__AVR_ATmega32U4__)


// Teensy 2.0


const int dipOSArray[] = {5}; //dip 1 used for os selection

const int dipDelayArray[] = {6, 7}; //dips 2 and 3. used as a way to add extra delay

const int dipSArray[] = {8, 9, 10}; //dips 4, 5 and 6. for what payload to run

const int buttonSPin = 12;

const int ledPin = 11;

#elif defined(__AVR_AT90USB1286__)


// Teensy++ 2.0


const int dipOSArray[] = {7, 8, 9};

const int dipDelayArray[] = {10, 11, 12};

const int dipSArray[] = {14, 15, 16, 17};

const int buttonSPin = 27;

const int ledPin = 0;


#endif // CORE_TEENSY

tfm.waitForDrivers(); //keeps pressing num lock until it changes

keyTrapSwitch = tfm.keyTrap(); //if caps lock is set it returns true and unsets caps lock

//creates a file called YouTubeScare.vbx Runs it to create YouTubeScare.lnk in the users startup folder, tells IE to open a full screen youtube scare

linkCreater("YouTubeScare", iexploreExe, "", youTubeScareUrl, delayPercent);

//run addtostartup\YouveBeenRickRolled.vbs off of a thumb drive with the volume label BKDRIVE, It places a .lnk file in the users startup folder

tfm.openFile("BKDRIVE", "addtostartup\\YouveBeenRickRolled.vbs", delayPercent); //non admin version

hope some can get use out of these library's and sketch

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...