H
heliopolarthing

  • Sep 15, 2023
  • Joined Dec 20, 2022
  • 2 discussions
  • 16 posts
  • giuliomoro

    So many thanks again, Indeed, I first made a mistake by creating an object rather than a message 🙁

    So I followed all your valuable information, and it works!!
    You really are by far the best 🙂
    Here is a screenshot of the print results.
    Also, you can see my pd patch which uses DFRobot's specs for distance calculation.
    alt text

  • And after a reboot >>>

    alt text

    It seems to read something, but it only prints 0 or 0 0

    It's probably due to the warning message about 'unsigned int' and 'float' in my previous post ?

    Thanks again

    • giuliomoro

      So many thanks !

      I just followed your step by step instructions.
      And here is what appears on the IDE.

      How does it sound for you ?
      alt text

      • Hi forum,

        I just opened this topic very similar to this one >>> It's about communication between a UART sensor > the good render.cpp code > and pure data with the r serial-uart4 object

        Many thanks

      • I've found on the DFrobot website this code for arduino

        
        /*
          *@File  : DFRobot_Distance_A02.ino 
          *@Brief : This example use A02YYUW ultrasonic sensor to measure distance
          *         With initialization completed, We can get distance value 
          *@Copyright [DFRobot](https://www.dfrobot.com),2016         
          *           GUN Lesser General Pulic License
          *@version V1.0           
          *@data  2019-8-28
        */
        
        #include <SoftwareSerial.h>
        
        SoftwareSerial mySerial(11,10); // RX, TX
        unsigned char data[4]={};
        float distance;
        
        void setup()
        {
         Serial.begin(57600);
         mySerial.begin(9600); 
        }
        
        void loop()
        {
            do{
             for(int i=0;i<4;i++)
             {
               data[i]=mySerial.read();
             }
          }while(mySerial.read()==0xff);
        
          mySerial.flush();
        
          if(data[0]==0xff)
            {
              int sum;
              sum=(data[0]+data[1]+data[2])&0x00FF;
              if(sum==data[3])
              {
                distance=(data[1]<<8)+data[2];
                if(distance>30)
                  {
                   Serial.print("distance=");
                   Serial.print(distance/10);
                   Serial.println("cm");
                  }else 
                     {
                       Serial.println("Below the lower limit");
                     }
              }else Serial.println("ERROR");
             }
             delay(100);
        }
      • Hi forum,

        I in fact try to configure this sensor with my Bela mini.
        I have read this topic >>>
        https://forum.bela.io/d/925-using-uart1-on-bela-mini/25
        And many orders too, Bela.io tutorials...

        But as my coding experience is 0, I'm not able to add the appropriate render.cpp file to monitor the UART output.
        I'll use the r serial-uart4 object in Pure Data.

        Help appreciated !
        Many thank in advance

        All the best

      • giuliomoro
        It works !

        I've finally find a mix between [declare WITH THE EXACT PATH] and importing abstractions directly in the project.
        And I have 0 error message concerning librairies.

        But.... I've a new one 😢

        alt text

        I need to read and write a text file.

        Please, is it possible to read and write a text file in Bela with pure data ?

        Note, I since imported a float.txt in my project with the IDE.
        I also simply changed the [apmasterfile $0-FloatPatterns p/float.txt] in my patch by [apmasterfile $0-FloatPatterns float.txt]
        So 0 error now.

        Just need to know if it is possible to store values in a text file ?

        I'll test it tomorrow in my modular synth setup.

        • giuliomoro
          Still perfect!
          Thanks again 🙂

          I did follow @lokki's advice.

          And I made the same observation.
          I then tried to compile iemlib with the same instructions as those detailed in post #100 (cyclone and ggee).
          But still the same.
          I then monitored the file contained in the bela via the terminal, and it appears a sparse_FIR~-help.pd and a sparse_FIR~.c
          Then directly in the IDE folder manager, where there is only a sparse_FIR~-help.pd

          Strangely, the [char2f] object started to work after turning the bela off and on again.

          Oops, I'll go update it.

          And check if the patch for which I am trying to install all these libraries works with the few iemlib objects that already work.

          These efforts are to be able to use the AutoPreset library
          https://github.com/MetaluNet/AutoPreset
          It consists of a series of abstractions allowing to make presets of all the settings of the patch, and to be able to interpolate these values ​​(if float) from one preset to another.

          All this to morph the presets of an i2c / midi / 8cv in / 2 audio in >>> i2c / midi / 8 cv out / 2 audio out matrix into my eurorack system + Digitakt + OTO Bam, with the Pepper.

        • giuliomoro
          This is what the IDE shows when I run the attached test patch

          Running Pd 0.48-2
          Audio channels in use: 2
          Analog channels in use: 8
          Digital channels in use: 16
          No MIDI device enabled
          bonk version 1.5
          fiddle version 1.1 TEST4
          pique 0.1 for PD version 23
          sigmund~ version 0.07
          error: ../pd-externals/iemlib/iemlib.l_arm: /lib/arm-linux-gnueabihf/libm.so.6: version `GLIBC_2.29' not found (required by ../pd-externals/iemlib/iemlib.l_arm)
          sparse_FIR~
          error: ... couldn't create
          verbose(4): ... you might be able to track this down from the Find menu.
          unsig~
          error: ... couldn't create
          char2f
          error: ... couldn't create

          alt text

        • giuliomoro
          Sorry, I didn't refresh my web page before to answer you this morning.
          Thanks again more 🙂
          It's just perfect to download directly compiled armv7 versions from deken !

          Download successful !

          The installation seemed ok, but when I checked that the new objects were installed, the BELA IDE gave me the error

          "couldn't create"

          So I checked the contents of the >pd-externals folder by reconnecting to Bela via the terminal and via the line

          ls ~/Bela/projects/pd-externals

          The result is this

          ggee pd-externals-for-bela

          So I reinstalled with the correct addresses for each new isolated library

          scp -r root@bela.local /Users/MYUSERNAME/Desktop/pd-externals-for-bela/iemlib root@bela.local:Bela/projects/pd -externals/

          And so on.

          I then checked for the presence of the files in pd-externals, then checked inside the folders. Everything is OK !

          On the other hand, Impossible to create these new objects!
          Only the ggee library works (the one I compiled myself following your first instructions)

        • giuliomoro
          hello, and thank you very much for your quick and precious help!
          So I followed your advice by downloading the file directly. Then I used my terminal with this line:

          cd /Users/MYUSERNAME/Desktop/pure-data-Bela-master

          then

          scp src/*h root@192.168.7.2:/usr/local/include/libpd/

          install seems ok 🙂

          Then, I compiled as indicated the external library ggee.
          I attach here a part of the terminal return (impossible to attach a .txt or .pdf file including all of this terminal return) which contains a lot of "warning".

          However, I continued until the end.

          Do you think that these multiple "warnings" hinder the proper functioning of the operation? Or is this normal?
          (sorry for my ignorance)

          The test with the patch including the ggee/moog~ object seems ok insofar as the object appears well on the IDE and is well connected!

          Thanks again,
          Waiting for your confirmation concerning my doubt ("warnings")

          I will now try to install the other two libraries (iemlib and moonlib)

          alt text

          • I follow this procedure >
            Now I found some time to do it (Friday night, 2am, of course).

            Preparation:
            - get extra header files needed to compile Cyclone (and ggee, and others) on Bela:
            - on your computer open a terminal and:

            git clone https://github.com/giuliomoro/pure-data &&\
            cd pure-data &&\
            scp src/*h root@192.168.7.2:/usr/local/include/libpd/

          • giuliomoro git clone https://github.com/giuliomoro/pure-data &&\
            cd pure-data &&\
            scp src/*h root@192.168.7.2:/usr/local/include/libpd/

            Hi and thanks so much for your help !
            Sorry abut this issue, but it seems that this first command line doesn't work.
            Link mentionne in it seems to fail.

            Also, I have this error message in my terminal (mac 10.14.6)
            xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

            I try to compile and install "ggee"
            All the detailed procedure fail.

            Also need to install "iemlib" and "moonlib"

            Help needed please ?
            All the best,

            Damien

            • Hello,
              I am a happy user of bela standalone systems, and would like to develop a multi-format hub/matrix for my eurorack modular synthesizer!
              This with Pure Data.

              The most urgent need to set up this system and to be able to return my progress here, and to share this project with you, is to be able to connect different Monome hardware to the Bela Pepper via i2c.
              Indeed, in my synth, I have:
              A Monome Arc > Monome Ansible > Monome Crow > er-301.
              I would like to be able to "fetch" the data from the Arc (which is interpreted by the Ansible and then injected in i2c) into the Bela.
              Then, I would like to be able to "send" data generated by the Bela directly to the Orthogonal Devices er-301 via i2c again.
              Finally, the ideal would also be to be able to send some data generated by the Bela to the Monome Ansible (here, simply preset changes)

              There are already bridges between Monome and Orthogonal devices (an object has been created in the er-301 to receive i2c orders via all Monome devices that can.
              And on the other side, Monome (which works with the .lua language) has developed a library to be able to discuss with a multitude of tools Here is the complete list
              https://llllllll.co/t/teletype-i2c-protocol/13642
              And here are two links to the official Monome doc
              https://monome.org/docs/ansible/i2c/
              https://monome.org/docs/modular/ii

              A big thanks to all of you !
              have fun