BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Problem with my project (Python)


#1

Hello guys
I work about a project for my exams and i work with python but i have a problem about this.
I have this message when i’m run my project

warning: virtual write to unregistered pin 7

this problem is recurring but i have this problem about 5 months and i need help.
Thanks


#2

So… register the pin :stuck_out_tongue:

Honestly, without seeing all your code, there is nothing we can do.

BTW, Blynk Python is in Alpha… thus might not be the best option for a exam project :wink:


#3

Thanks for you answer !

I work with node.js first but my professor asked me to use python.
Do you think i continue with node.js or continue with pyhton ?

I say is an alpha and i restart my program many times so my program is the example of the site.


#4

Up to you… but there is very little support for Blynk python. Probably a bit more for Blynk NodeJS, but best support is for C++ with Arduino/ESP & Blynk.

There are a few examples… but I am not going to guess :wink:


#5

this is my program:

import BlynkLib
import time

BLYNK_AUTH = '94a4903a4exxxxxa58d2347aa018'

# Initialize Blynk
blynk = BlynkLib.Blynk(BLYNK_AUTH)

# Register Virtual Pins
@blynk.VIRTUAL_WRITE(1)
def my_write_handler(value):
    print('octave: {}'.format(value))


    
@blynk.VIRTUAL_READ(2)
def my_read_handler():
    # this widget will show some time in seconds..
    blynk.virtual_write(2, time.ticks_ms() // 1000)
def my_user_task():
    print('changement d"octave')
    blynk.virtual_write(2, time.ticks_ms() // 1000)
# Start Blynk (this call should never return)
blynk.run()

#6

Works fine for me… although you do have an unnecessary repeat of this command…

Only time I got a similar message was while accidently running two client scripts (my own and yours) with same Auth code (I copy pasted wrong one at first). So you may possibly be running multiple scripts in the background?


#7

actually, i try to activate a Virtual LED when my function ‘octave’ up but I don’t have a second virtual pin, the terminal say "warning: virtual write to unregistered pin 2 "
you have an idea ? I need explication for understanding how we add a virtual pins because the fist virtual pins it’s easier for create but a second I don’t know


#8

You already use two vPins… V1 for a control widget (slider?) & V2 for a display widget (should be set to a reading rate of 1 sec)… just use the similar commands with different pin numbers that match your App widget.


#9

that’s all ? but I don’t have the documentation when the different function and variable for example for use a LED and activate hem


#10

Welcome to Alpha :stuck_out_tongue: … You have to rely on other Python tutorials via Google and lots of guessing, trial and error… this is how I am slowly learning Blynk Python.


#11

And very it’s perfect that!
thanks for the information i post my new program


#12

import BlynkLib
import time

BLYNK_AUTH = ‘94a4903a4e254134ba5a58d2347aa018’

Initialize Blynk

blynk = BlynkLib.Blynk(BLYNK_AUTH)

Register Virtual Pins

@blynk.VIRTUAL_WRITE(1)
def my_write_handler(value):
print(‘octave: {}’.format(value))
if float(value) ==1:
print(‘changement d"octave’)

@blynk.VIRTUAL_WRITE(2)
def my_write_handler(octave):

@blynk.VIRTUAL_READ(2)
def my_read_handler():
# this widget will show some time in seconds…
blynk.virtual_write(2, time.ticks_ms() // 1000)

Start Blynk (this call should never return)

blynk.run()

the program works as I want him but I search for use a LED now


#13

Please properly format all posted code here as per the Welcome Topic directions…