LoPy to LoPy analog



  • alt text

    hi, im trying to send the analog value i detected on LoPy A to LoPy B. i have try using the coding to send 'Ping' and 'Pong' but it does not show the analog value. is there anyone can help? thanks



  • @livius OMG! it works! i tried s.send('ADC value:' + str(value)) but i never try s.send("ADC value:" + str(value)) thank you so much!



  • @vicky_
    simple write this

    s.send("ADC value:" + str(value))
    


  • @livius thanks for your fast response! :D :D
    i actually dont know how to put the real value. left lopy is function as receiver, and right lopy is function as sender. left wanted to send 'Ping' as a string to communicate with left and after left received the string it wont display it, instead it will send out the 'ADC value:' as string and ___ real value which i dont know what should i put to the left and left will print out .

    Hopefully my explanation did not confuse you. i really have no idea what to do :(



  • @vicky_
    Yes, i mean send as print

    what do you mean you got from this?
    'ADC value: ' 'value %f'

    where do you put real value if you have 2 strings? Look at apostrofs ;-)

    look at your left panel (which is ok) and how you do send, only 2 apostrofs not 4 as on right panel ;-)



  • @livius print? i did not print('ADC value: ' 'value %f') instead i s.send('ADC value:' 'value %f') if print it will only display on the console. what i want to do is send the recorded analog value to another Lopy. i think must be something wrong with 'value %f' but i dont know what should be replace.



  • @vicky_
    i do not understand this line

    print('ADC value: ''value %f')
    

    as you can see you got by this result aimplw string ADC value: value %f

    Why do not you do the same as before in above line with print?

    print("ADC value:" + str(value))
    


  • @livius hi. sorry. this is my coding for both lopy

    alt text



  • @vicky_
    First help us help you.
    Show some portion of code and we then can help you.


Log in to reply
 

Pycom on Twitter