Author Topic: PLCLIB for Arduino- need help in understanding how to use with Servo library  (Read 2319 times)

0 Members and 1 Guest are viewing this topic.

Offline IconicPCBTopic starter

  • Super Contributor
  • ***
  • Posts: 1534
  • Country: au
Anybody have any experience with the above libraries.

Am having problems in driving Servo while using  the PLC library.

Any hints welcome... please....
 

Offline ajb

  • Super Contributor
  • ***
  • Posts: 2599
  • Country: us
It would help if you described what sorts of problems you're experiencing and what troubleshooting steps you've taken thus far.  Also what hardware you're using--"Arduino" isn't terribly specific in that respect these days.

As a shot in the dark, I would guess that the two libraries are trying to use the same timer(s).
 

Offline IconicPCBTopic starter

  • Super Contributor
  • ***
  • Posts: 1534
  • Country: au
I am trying to use PLClibrary to resolve some control issues and the result of the decisions leaves me with three options each calling for a positional servo outcome.
PLC library does not of itself offer analog variable processing other than analogue read , PWM and Servo outputs.

All would be fine if only a single value needed to be passed to the Servo library ...however making a selection of one of three variables does not seem possible precluding a degree of automation.

PLC library relies on scanVariable whose content is valid immediately after the evaluation of the "rung".
I have tried saving content of the scanVariable immediately post the evaluation with no joy,
 

Offline Bruce Abbott

  • Frequent Contributor
  • **
  • Posts: 627
  • Country: nz
    • Bruce Abbott's R/C Models and Electronics
All would be fine if only a single value needed to be passed to the Servo library ...however making a selection of one of three variables does not seem possible precluding a degree of automation.
servo.write() takes a single parameter - the angle to set the servo to. What do your three variables contain, and why do you need to 'make a selection of one' of them?
 

Offline IconicPCBTopic starter

  • Super Contributor
  • ***
  • Posts: 1534
  • Country: au
The three variables each contain a servo position.
The position is selected on outcome of  combinations calculated by PLC library ( https://github.com/wditch/plcLib )
Unfortunately the original website  www.electronics-micros.com has gone belly up precluding me form reaching the author of the library.
 

Offline Bruce Abbott

  • Frequent Contributor
  • **
  • Posts: 627
  • Country: nz
    • Bruce Abbott's R/C Models and Electronics
The three variables each contain a servo position.
The position is selected on outcome of  combinations calculated by PLC library
Still not clear. How do you choose which position to use? Rather than continuing this guessing game, post your code so we can see what you are trying to do.


 

Offline phil from seattle

  • Super Contributor
  • ***
  • Posts: 1029
  • Country: us
I second the point about lack of clarity. Have you looked at the PLCLIB source code?  You have it on your machine.
 

Offline IconicPCBTopic starter

  • Super Contributor
  • ***
  • Posts: 1534
  • Country: au
Apologies for no response..day has been full and i am yet to hit the sack.
I hope to be able to get back to you with a clearer statement and sample code..
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf