The pain.exe and exit.exe files (Fitness Unpersonal Trainer)

Selfbondage software and other kinky developments

Moderators: Riddle, Shannon SteelSlave

sensisub
*
Posts: 1
Joined: 02 Feb 2012, 03:20

Re: The pain.exe and exit.exe files (Fitness Unpersonal Trai

Post by sensisub »

Hello there,

Qwerty, I've been triing the arduino program but i didn't find how to change the COM port (my port 4 is already used and my arduino is on 8th).
Would you have a solution?
Thanks
User avatar
bluebird67
*
Posts: 14
Joined: 22 Nov 2009, 22:27
Location: UK

Re: The pain.exe and exit.exe files (Fitness Unpersonal Trai

Post by bluebird67 »

PiJoy wrote: @querty212,

Your idea of using the presence or absence of processes (with known names) on the active process list is a creative approach to inter-process communication! Your approach maps well to simple on/off states, but I don't see how it could pass non-binary info, such as a PWM command, or distribute input values (read by the Arduino) to interested processes. However, if you and your users want binary commands, your name-on-task-list method of gathering commands from multiple processes sounds like it'll work. I suspect it'll be easier to implement than sockets. Idea: for PWM outputs, you could pre-set a PWM level, and use commands (from the "funnel" process on the PC) to enable/disable it.
Another good approach to inter-process communications is to use a file. For example, the program that 'owns' the Arduino interface, I'll call it the server program, could check a file for commands every few seconds.

A command would be a line added to the file, with a timestamp and some keywords indicating what signals to send the Arduino. The idea of the timestamp is that the server program remembers the last timestamp that it has acted on (call it 'last action time'.) Each time it reads the file, it sees if there are any commands with timestamp later that the one last acted on but earlier than the current time. It acts on these commands and remembers the new 'last action time'. With this system, multiple client programs can send commands to be acted on either immediately or at a point in the future. One could also test the server program by writing a script of timed commands.

Reading the whole file from the beginning each time may sound a little inefficient - a program in a language such as C could read from the previous end-of-file - but for this application, it should not be a problem.
User avatar
qwerty212
Moderator
Posts: 1064
Joined: 23 Mar 2010, 20:24

Re: The pain.exe and exit.exe files (Fitness Unpersonal Trai

Post by qwerty212 »

sensisub wrote:Hello there,

Qwerty, I've been triing the arduino program but i didn't find how to change the COM port (my port 4 is already used and my arduino is on 8th).
Would you have a solution?
Thanks

Hello sensisub. I do not know how to change the port of your arduino board, but I'm going to update all the pain.exe to make them compatible with the new programs (the Memory Game,etc..) so if you want I can code for you a version that works on the 8t port.

Greets from Barcelona
BoundBG
*
Posts: 2
Joined: 10 Mar 2013, 18:28

Re: The pain.exe and exit.exe files (Fitness Unpersonal Trai

Post by BoundBG »

Can someone reupload the one that plays your mp3 files?
Mediafire says link is invalid.

Thanks in advance.
User avatar
qwerty212
Moderator
Posts: 1064
Joined: 23 Mar 2010, 20:24

Re: The pain.exe and exit.exe files (Fitness Unpersonal Trai

Post by qwerty212 »

BoundBG wrote:Can someone reupload the one that plays your mp3 files?
Mediafire says link is invalid.

Thanks in advance.
Hello BoundBG, here you can get the program:
https://docs.google.com/file/d/0B7G1l-I ... sp=sharing

Play safe.
kinkduino
*
Posts: 5
Joined: 16 Jun 2013, 05:39

Multiple Outputs from 1 Arduino

Post by kinkduino »

Here is a link to a pair of Arduino files and four .exe files each of which triggers a different output from the Arduino

https://docs.google.com/file/d/0Byd1_3z ... sp=sharing

Each .exe sends a different character to the COM4 port and then exits leaving the port free, all the timing and set up is done on Arduino (as the files are very much easier to edit than .exe files and I am not experienced with C++) so each exe. sends it's signal and closes within a fraction of a second.

Near the bottom of the file are 3 functions called 'executePain1' thru 3 which you can edit to adjust the payload to suit whatever you want to control, the outputs just switch on and off output pins on the Arduino so you can connect transistors (or relays) to the outputs to control whatever you want.

The release pin can be set either to be on for the session and then switch off (to keep a magnet energised during the session for example) or to switch on at the end of the session (to operate a solenoid for example).

By default:

pain1.exe switches on pin 13 for 2.5 seconds
pain2.exe switches on pin 12 for 5 seconds
pain3.exe pulses pin 11 four times a second for 15 seconds
release.exe switches on pin 10 (and leaves it on)

Use at your own risk - and please test everything first!

The code is here:

Code: Select all

// Kinkduino 0.2
//
// ALPHA VERSION - USE WITH CAUTION!
//
// this allows 3 different outputs using each of the 3 
// pain.exe files plus an output for a release using
// release.exe 
//
// the exe. file work by sending a charictor on the serial 
// port to COM4 you must set your arduino to COM4 for this
// to work
//
// you can configure the length of time for each output
// and what they do (whether they go to the same or  
// different pins for instance or operate a servo)using 
// the 4 payload modules at the bottom
//
// you can set the release to be either normally ON or
// normally OFF - by default it will switch ON to release
//
// BE SAFE - TEST EVERYTHING FIRST!

// settings are here:

// set the duration of time for each pain event in seconds
int t1 = 2.5; 
int t2 = 5;
int t3 = 15;

// set the output pins for the pain events (they must be different)
// if you want to use differnt events to trigger the same output, 
// you can do that at the bottom by setting all the events to opperate 
// the same pain pin
int pain1 = 13; // pin 13 has an LED so good for testing
int pain2 = 12;
int pain3 = 11;

// set the start voltage (on or off)for release output pin,  
// use '0' to start low and '1' to start high 
// you should choose '0' if your using a solenoid and '1' for an 
// electomagnet
int eXit = 0; // set the release orientation here (0 or 1)

// and set the output pin for release
int Xpin = 10; 

// alter the next section of code only if you know what you are doing
// the execute actions are at the bottom

#include <Timer.h> // calls the timer module

Timer t; // set timer t

int val = '0'; // set var to hold accumulation of input values

void setup()
{
  Serial.begin(9600); // start the serial port listening

  pinMode(pain1, OUTPUT); // set the pins up
  pinMode(pain2, OUTPUT);
  pinMode(pain3, OUTPUT);
  pinMode(Xpin, OUTPUT);

  digitalWrite(pain1, LOW); // pull the pain pins low
  digitalWrite(pain2, LOW);
  digitalWrite(pain3, LOW);

  if (eXit = '0') // check if release pin should start high or low
    {
    digitalWrite(Xpin, LOW); // if eXit is '0' then the pin starts low
    }
    else
    {
    digitalWrite(Xpin, HIGH); // otherwise it starts high
    }
}

void loop()
{
  t.update(); // this is required for the timer function for the payloads
  if ( Serial.available())
  {
    char punish = Serial.read(); // punish is the variable set from the COM4 input

    if(punish >= '0' && punish <= '9') // if 'punish' is a number
    val = val * 10 + punish - '0';     // do something I don't understand with it
    
    else if(punish == '-') // but if it's a minus sign
    {
     val = 0; // reset the variable
     executePain1(); // and execute pain 1
    } 
    else if(punish == '+') // if it's a plus sign
    {
     val = 0; // reset the variable
     executePain2(); // and execute pain 2
    } 
    else if(punish == ',') // if it's a comma
    {
     val = 0; // reset the variable
     executePain3(); // and execute pain 3
    }
    else if(punish == '*') // but if it's the star
    {
     val = 0; // reset the variable
     executeRelease(); // and operate the release
   }  
  }
}
// here are the payloads - you can change these for your own set-up
//
// change all the 'pain' variables to 'pain1' if you want the different
// times set in 't1' thru 't3' (above) to act on the same ouptut pin
//
void executePain1() // this is payload triggered by pain_1.exe
{
  Serial.write( "Pain 1 Activated");  // send debugging message
 digitalWrite(pain1, HIGH);           // turn on 'pain1' pin
 t.after( t1 * 1000, pain1_off);      // after the period set in 't1' turn off 'Pain1' pin
}

void executePain2() // this is payload for triggered by pain_2.exe
{
 Serial.write( "Pain 2 Activated");  // send debugging message
 digitalWrite(pain2, HIGH);           // turn on 'pain1' pin
 t.after( t1 * 1000, pain2_off);      // after the period set in 't1' turn off 'Pain1' pin
}

void executePain3() // this is payload for triggered by pain_3.exe
{
  Serial.write( "Pain 3 Activated" );
  t.oscillate(pain3, 125, LOW, 4 * t3); // pulse 'pain3' 4 times second for the period set in t3 (above)
}

void executeRelease() // this is the release action, it switches low => high or high => 
                      // low depending on the eXit variable setting (above)
{
  Serial.write( 'Release Activated \r' );
   if (eXit = '0') // check if Xpin started high or low
    {
    digitalWrite(Xpin, HIGH); // if it was low; go high    
    }
    else
    {
    digitalWrite(Xpin, LOW); // otherwise go low
    }
}

void pain1_off() // switches off 'pain1'
{
  digitalWrite(pain1, LOW);
}

void pain2_off() // switches off 'pain2'
{ 
  digitalWrite(pain2, LOW);
}

void pain3_off() // switches off 'pain3'
{
  digitalWrite(pain3, LOW);
}
A little of the code is pinched from the original Arduino code that shipped with pain and exit.

The serial request is sent using this method: https://github.com/tedburke/SerialSend

For a diagram of how to connect a relay to the Arduino, look here: http://playground.arduino.cc/uploads/Le ... relays.pdf or here: http://blog.lib.umn.edu/willow/makingar ... rduino.pdf
User avatar
qwerty212
Moderator
Posts: 1064
Joined: 23 Mar 2010, 20:24

Re: The pain.exe and exit.exe files (Fitness Unpersonal Trai

Post by qwerty212 »

Thanks a lot for sharing it with us kinkduino.

I will use your release to learn a little bit more about the arduino.

Gracias!
Grindar
*
Posts: 4
Joined: 24 Jun 2012, 16:11

Re: The pain.exe and exit.exe files (Fitness Unpersonal Trai

Post by Grindar »

It's been a while since anyone commented on this thread. I don't mean this to be a bump but I wanted to drop another thank you to qwerty212 for these files and his work in programming them.

I'm going to be doing a session later today and it wouldn't be possible without these programs. The arduino updates are especially appreciated. That's what I use for my setup.

I just wanted to say 'Thanks' and let you know people are still using these programs.
kinkduino
*
Posts: 5
Joined: 16 Jun 2013, 05:39

Re: The pain.exe and exit.exe files (Fitness Unpersonal Trai

Post by kinkduino »

sensisub wrote:I've been triing the arduino program but i didn't find how to change the COM port (my port 4 is already used and my arduino is on 8th).
Would you have a solution?
Thanks
The COM port is set by the computer and not by the Arduino, you can change it in 'Device manager' (if you are using windows), to open device manager:

1. Click on the Start button and then choose Control Panel.
2. Click on the System and Security link.
3. In the System and Security window, click on the Device Manager link located under the System heading.

In device manager you need to expand the Ports (COM & LPT) by clicking the little arrow next to it, then you will see all the serial devices listed (most likely just your Arduino) and all their COM port numbers.

To change the COM port:

1. Right click on your Aduino in the list then open its Properties
2. On the Port Settings tab click Advanced....
3. At the bottom of the advanced settings window you will see a button with the current port number and an arrow next to it, open this and you can select a new port number for your Arduino.

Note: Some of the port numbers may say (in use) next to the port number, and will show a warning if you select them. Unless you have multiple devices physically connected it is normally safe to continue, test everything first!
Hiss000
*
Posts: 9
Joined: 19 Oct 2012, 15:35

Re: The pain.exe and exit.exe files (Fitness Unpersonal Trai

Post by Hiss000 »

Its seems are stupid question. If on antybreak collar write "Activate vibration dogs larynx, bark others dogs dont active it" that file pain.exe will work thanks to shake the handset or only pain.exe work when antybreak collar are activate with sound? i think about this collar ( http://www.ebay.com/itm/Anti-Bark-Elect ... 43c43697a1 ) if someone know that this work i will be thankfull for this. Or somebody buy some other antybreak collar what working and can help me in chose?

sry for bad eng ;c
pansexual
**
Posts: 116
Joined: 28 Feb 2010, 23:45

Re: The pain.exe and exit.exe files (Fitness Unpersonal Trai

Post by pansexual »

I already tried that bark collar and e-stims with sound input. The bark collar is crap. Though the e-stims are the more expensive options (around 200€ for the cheapest version with sound input), they are reliable, safe, adjustable, conformtable, quite everything you want. Better invest that money if you want to be nicely shocked. :wink:
Plan ahead. Don't be overambitious. Slowly step by step. Play safe. Have fun. And tell us.
Hiss000
*
Posts: 9
Joined: 19 Oct 2012, 15:35

Re: The pain.exe and exit.exe files (Fitness Unpersonal Trai

Post by Hiss000 »

But this break collar what u buy working with sound from headphones or no? if working can u say what u have collar? :] (picture,name this or something)
pansexual
**
Posts: 116
Joined: 28 Feb 2010, 23:45

Re: The pain.exe and exit.exe files (Fitness Unpersonal Trai

Post by pansexual »

Sorry, but I threw it away. There are not so many on the market. But they are designed for dogs necks and barks. Would have been better I never bought it, good advice have been given. :-)

But now I have E-Stim A-Box for over two years, especially using it's sound input, and am very satisfied. So satisfied I bought the 2B Power Pox some months ago, and am very happy with it.

I can only stress out my recommondation for serious hardware designed for this purpose instead of wasting money for cheap tries and abusing hardware with different intentions (already tried an electric fly swatter).

If you cannot afford it now, save the money and wait till you can. Just another good advice.

Play safe and sane :-)
Plan ahead. Don't be overambitious. Slowly step by step. Play safe. Have fun. And tell us.
Frunobulax_1
*
Posts: 2
Joined: 06 Aug 2015, 12:20

Re: The pain.exe and exit.exe files (Fitness Unpersonal Trai

Post by Frunobulax_1 »

Hi All,
Upgrade to Windows 10 seems to block the pain.exe files to communicate to the arduino.
Everything else works fine: Arduino Uno responds normally to the Programmer; Com 4 is active when connected to the arduino. But using the pain.exe results in this dialog box:

"Can't perform this operation on a closed port.
Port = None
Channel number = 1"

Checked com4 with 'Coolterm' and even then it works like a charm.
Tried it on a different laptop (again with Win10) and remarked that this problem seems to repeat it self.
And that is where my knowledge stops.
Any suggestions?
User avatar
qwerty212
Moderator
Posts: 1064
Joined: 23 Mar 2010, 20:24

Re: The pain.exe and exit.exe files (Fitness Unpersonal Trai

Post by qwerty212 »

Frunobulax_1 wrote:Hi All,
Upgrade to Windows 10 seems to block the pain.exe files to communicate to the arduino.
Everything else works fine: Arduino Uno responds normally to the Programmer; Com 4 is active when connected to the arduino. But using the pain.exe results in this dialog box:

"Can't perform this operation on a closed port.
Port = None
Channel number = 1"

Checked com4 with 'Coolterm' and even then it works like a charm.
Tried it on a different laptop (again with Win10) and remarked that this problem seems to repeat it self.
And that is where my knowledge stops.
Any suggestions?
That's weird because as I explain here I have created a new teasing device:
Image
and it works with a very similar pain.exe invoked from a Windows 10 :? Gotta check how does it works with the old pain.exe to see what's different.

Greets from Barcelona
Post Reply