Quantcast
Channel: Support - Pimoroni Buccaneers
Viewing all articles
Browse latest Browse all 6933

Pantilthat - library

$
0
0

@rjhazzeld wrote:

I am getting an error when I use a value from fieldstorage with servo_two(). This is the string containing the value:
stopallv=&lspeedsv=+0+&rspeedsv=+0+&pansv=&tiltsv=3&ledsv=

The error is <type ‘exceptions.ValueError’> Value ntiltv should be between -90 and 90 …

tiltsv=3 being the input variable and value which is between -90 and 90

The python code is:
if form.getfirst(“tiltsv”) != “”:
ntiltsv = int(form.getfirst(“tiltsv”))
PanTilt.servo_two(“ntiltv”)

The error report suggests the error is thrown by pantilthat.py line 137 - max=value_max))

The same error is reported if the value is 0. If i leave out the int() I get a message that the value is not a string or number.
Entering values via the console seems to work correctly but from python the values seem to be incremental rather than to a specific position e.g. if the value 10 were input twice rather than staying at 10 the servo would move to 20.

My difficulties are probably of my own making !! I’d be grateful for some help.

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 6933

Trending Articles