Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    LoPy to LoPy analog

    Scheduled Pinned Locked Moved LoPy
    lopy to lopys
    9 Posts 2 Posters 1.9k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • V Offline
      Vicky_
      last edited by Vicky_

      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

      L 2 Replies Last reply Reply Quote 0
      • L Offline
        livius @Vicky_
        last edited by

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

        think about people first, then computers

        1 Reply Last reply Reply Quote 0
        • V Offline
          Vicky_
          last edited by

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

          alt text

          1 Reply Last reply Reply Quote 0
          • L Offline
            livius @Vicky_
            last edited by livius

            @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))
            

            think about people first, then computers

            V 1 Reply Last reply Reply Quote 0
            • V Offline
              Vicky_ @livius
              last edited by Vicky_

              @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.

              L 1 Reply Last reply Reply Quote 1
              • L Offline
                livius @Vicky_
                last edited by livius

                @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 ;-)

                think about people first, then computers

                V 1 Reply Last reply Reply Quote 0
                • V Offline
                  Vicky_ @livius
                  last edited by Vicky_

                  @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 :(

                  L 1 Reply Last reply Reply Quote 0
                  • L Offline
                    livius @Vicky_
                    last edited by

                    @vicky_
                    simple write this

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

                    think about people first, then computers

                    V 1 Reply Last reply Reply Quote 1
                    • V Offline
                      Vicky_ @livius
                      last edited by

                      @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!

                      1 Reply Last reply Reply Quote 1

                      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                      With your input, this post could be even better 💗

                      Register Login
                      • 1 / 1
                      • First post
                        Last post

                      Pycom on Twitter

                      Pycom