GearHeads Corner
March 25, 2017, 04:39:36 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: 1 [2]
  Print  
Author Topic: Script+Pokeys  (Read 1247 times)
0 Members and 2 Guests are viewing this topic.
satco
Newbie
*
Posts: 28


View Profile
« Reply #15 on: August 08, 2016, 08:29:00 AM »

Hi Art,
I test following:

 pinstate = Pokeys1.G etPinDig(9);
 if( pinstate == 1 )
    {
  print("pinstate"+1);
    }
else
{
 print("pinstate"+0);
}

It works good. Then I test:

global  MonitorPi n9 = function()
{
  while(1)
  {
    block( "MotionPin 9");
    pinstate = Pokeys1.G etPinDig(9);
    if( pinstate == 1 )
    {
  print(" pinstate");
    }
  }
};
MonitorPi n9();

I have no reaction on Pin9 changes. Where is error? The same result with "IOPin9".

Best regards,
Anatolii.
Logged
ArtF
Administrator
Hero Member
*****
Posts: 4585



View Profile
« Reply #16 on: August 08, 2016, 09:52:32 AM »

Anatolii:

 Hmm, I just tried this in the script window as a test..

block("MotionPin 1");
print("Done");


  Run that script and the script light should stay flashing. Its waiting on the block.
When I jumper pin1 to ground, the word done is printed in the log and the light stops flashing.

Can you try that test for me? Seems to work here, the block gets released if I go from 1 to 0 or 0 to 1..

Thx
Art
Logged

Thanks, have fun,
Art
satco
Newbie
*
Posts: 28


View Profile
« Reply #17 on: August 09, 2016, 01:27:01 AM »

Hi Art,

I set "NO" button among Pin1 and GND. In NO condition Pin1 hase 3.7V. In NC Pin1 hase 0V.

I have tested:
block("MotionPin 1");
print("Done"+Pokeys1.GetPinDig(11));


I push Button to NC and wait in this condition . The word "Done0" is printed in the log and the light stops flashing.
So the block gets released if I go from 1 to 0.

My mistake is I try to set blok to Pin9. Pin9 in my Hard is DigOut Smiley

Best regards,
Anatolii.
Logged
ArtF
Administrator
Hero Member
*****
Posts: 4585



View Profile
« Reply #18 on: August 09, 2016, 06:28:27 AM »

Anatolii:

 lol, makes sense. I do such things as well. Glad to hear it works. You can also block on multiple options if you like.. for example.. .


 myblock = block( "MotionPin 9" , "IOPin9", "MotionPin 11");

 if( myblock == "MotionPin 9" ) { .......do whateer" };

etc..

  Just so you ( and anyone else working with blocks.. ) knows.

  This makes it possible to write one script that monitors and deals efficient ly with multiple pins.
This can save a lot of scripting in multiple scripts. Its unknown how many you can run simultane ously..
Ive run up to 50 scripts at once while Gcode runs as a test, but Im assuming this depends on CPU
power and your system. Not many people run Auggie , so it will take awhile for limitatio ns to be
figured out fully. All I know is it runs my laser pretty good. Smiley

Art

 
Logged

Thanks, have fun,
Art
satco
Newbie
*
Posts: 28


View Profile
« Reply #19 on: August 09, 2016, 09:11:45 AM »

Hi Art,

Auggie like a sleeping Dragon. I will be very glad to help you wake him up. If I can to test or make  anything else, let me know please.

Is it possible to block an Analog Input. If input signal change - start script? It will be a very powerful tool to work with analog signals.

Best regards,
Anatolii.
Logged
ArtF
Administrator
Hero Member
*****
Posts: 4585



View Profile
« Reply #20 on: August 09, 2016, 09:50:43 AM »

Hi A:

  It isnt really possible to block on an analogue because I havent set any way to set a range.
Ask me about this in the fall, if I add a couple calls to set a blocking range, it owuld be possible
to block on signal change of more than a set tolerance .Analogue s tend to swing, so I was worried abotu too many block calls.

Thx

Art
Logged

Thanks, have fun,
Art
satco
Newbie
*
Posts: 28


View Profile
« Reply #21 on: August 09, 2016, 12:10:02 PM »

Hi Art,

Ok, I test block and waiting fall.

Best regards,
Anatolii.
Logged
Pages: 1 [2]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!