First experiments: OpenMV with SPIKE Prime

Поделиться
HTML-код
  • Опубликовано: 6 мар 2021
  • I connected an OpenMV camera to a LEGO SPIKE Prime hub to make it follow my face around the room. Both run Micropython code and they communicate over UART. Then I proceeded to use the i2c capabilities to connect a non-LEGO sensor. The LEGO hubs do not natively support I2C so I used OpenMV as a bridge.
    Get the breakout board here:
    www.antonsmindstorms.com/prod...
    Please like and ask any questions you have in the comments!
    Get the T-Shirt on: shop.spreadshirt.nl/antons-mi...
    Support my work on: / antonsmindstorms
    For complete building instructions and in-depth articles go to:
    www.antonsmindstorms.com

Комментарии • 45

  • @satan4768
    @satan4768 3 года назад +2

    Cool stuff, keep up the great work

  • @ArtMGavr
    @ArtMGavr 3 года назад +1

    Cool! Mindblowing! Keep it up!

  • @marchelfman3278
    @marchelfman3278 3 года назад +4

    I have an OpenMV which I’ve never used, so looking forward to your full tutorial. I just finished a more primitive way of connecting a camera to a Spike Prime which I intend to use for object finding and following. I use a Pixy camera connected to a microView Arduino along with a tiny DAC board from Adafruit to convert the centroid data from the camera to a varying voltage. This voltage drives an LED which varies in brightness with the change in voltage. Finally, I point a Spike color sensor at the LED which produces corresponding values which can be used by a Python PID program to control the motors for object following. It’s a bit of a kluge, but it works, and, like your time of flight sensor, I can plug any sensor I want (analog, digital or I2C) into the microView and get its data into the Spike hub.

    • @AntonsMindstorms
      @AntonsMindstorms  3 года назад

      I am working on an uart protocol to make this easy and generic. Subscribe to be notified. I will also publish on my blog. Now I'm working hard to get new supplies of this board.

    • @marchelfman3278
      @marchelfman3278 3 года назад

      @@AntonsMindstorms Looking forward to the boards and the code

    • @marchelfman9828
      @marchelfman9828 3 года назад

      @@AntonsMindstorms I'm eager to buy the interface board, so wondering if you've made any progress on the easy to use uart protocol.

    • @AntonsMindstorms
      @AntonsMindstorms  3 года назад

      The protocol works fine now. You can read all about it here: github.com/antonvh/LMS-uart-esp/tree/main/Libraries/UartRemote This weekend I'll update the H7 project with the latest version of the library.

  • @mtarquinio
    @mtarquinio 3 года назад +2

    Awesome demo. I am looking forward to the instructions on how to replicate it

    • @AntonsMindstorms
      @AntonsMindstorms  3 года назад

      Coming soon! When I find the time, they will appear on github, here: github.com/antonvh/LMS-uart-esp

  • @ikarib
    @ikarib 3 года назад +2

    I was also able to connect pixycam v2 using I2C class in umachine module in Robot Inventor firmware (unfortunately I could not find umachine class in Spike Prime firmware). I am also experimenting now with M5Stack StickV over UART using Lego ultrasonic sensor block and exact distance values.There is also HuskyLens from DFRobot that is easier to program than M5StickV which can also be programmed using MicroPython.

    • @AntonsMindstorms
      @AntonsMindstorms  3 года назад

      Nice. Where can I find more about that 2C class?

    • @ikarib
      @ikarib 3 года назад +2

      I was able to connect HiTechnic Color Sensor with Spike Prime. This sensor communicates over I2C and works with 3.3V. I connected blue wire (SDA) to pin 6, yellow (SCL) to pin 5, green (VCC) to pin 4 and red (GND) to pin 3. You can also split the cable to add multiple sensors on one Spike Prime port (if you can change the sensor's I2C address). Here is my code below.
      from umachine import I2C,Pin
      from hub import port
      port.C.mode(port.MODE_GPIO)
      i2c=I2C(scl=Pin.cpu.D11,sda=Pin.cpu.E4)
      print(i2c.readfrom_mem(1,0,24))
      c=i2c.readfrom_mem(1,66,4)
      print("color=",c[0]," red=",c[1]," green=",c[2]," blue=",c[3])

    • @AntonsMindstorms
      @AntonsMindstorms  3 года назад

      It doesn't work for me (ENODEV). Where did you find the cpu pin numbers?

    • @ikarib
      @ikarib 3 года назад

      Look up the Facebook post by Gianluca in august

    • @AntonsMindstorms
      @AntonsMindstorms  3 года назад

      @@ikarib I found gianluca's github repo with the pin numbers, thanks. That is great. I also discovered that he has deceased last December due to Covid. That is really sad, a big loss.

  • @yanbingli7779
    @yanbingli7779 2 месяца назад

    Very cool, I'd like to order few, but can not find the product on your page, any place to find it? Thank you!

    • @AntonsMindstorms
      @AntonsMindstorms  2 месяца назад

      It is here: www.antonsmindstorms.com/product/spike-smart-camera-breakout-board-spike-openmv/

  • @charleschong352
    @charleschong352 Год назад

    Do you sell the board ? cant seem to find in your website

  • @zhanzo
    @zhanzo 3 года назад +2

    Can I use mindstorms hub to control Technic+ hubs (ideally over bluetooth) ?

    • @AntonsMindstorms
      @AntonsMindstorms  3 года назад +1

      Yes, you can. Well, in theory. All of the hubs you mention have BLE chips. And you can access that in Python. No one has built handy framework for this yet. (That I know) So it will be hacking and pioneering at this stage.

  • @yuanyoshimi4968
    @yuanyoshimi4968 Год назад

    what ide did you use?

  • @mikey4590
    @mikey4590 3 года назад +1

    Is it possible to use scratch codes to do that?

  • @glaubersantos8597
    @glaubersantos8597 3 года назад

    do you know of a third party manufacturer that sells sensors for the new mindstorm 51515?

    • @AntonsMindstorms
      @AntonsMindstorms  3 года назад

      No but with my breakout board, you can connect any cheap i2c or uart sensor you find in chinese webshops. I exepct new stock today. antonsmindstorms.com/product/spike-ri-wifi-i2c-board/

    • @leoarndt2849
      @leoarndt2849 Год назад

      @@AntonsMindstorms Hey there! On your website it says "Page not found". Do you still sell those boards?

    • @AntonsMindstorms
      @AntonsMindstorms  Год назад

      @@leoarndt2849 They are out of stock. I have one very last one lying around. Email me or message me on facebook/insta if you want it!

  • @enimatek
    @enimatek 3 года назад +1

    Nice! Do you know if it is possible to connect to the Hub (51515) from OpenMV and use the REPL directly?

    • @AntonsMindstorms
      @AntonsMindstorms  3 года назад

      Yes you can, why?

    • @enimatek
      @enimatek 3 года назад

      ​@@AntonsMindstorms just exploring the possibilities of the 51515 set before purchase, already ordered the OpenMV based on your vid, combined with a Gelo build this could be very interesting.

  • @Erlan004
    @Erlan004 2 месяца назад

    i want to buy, breakout board, but i cant. Can you shipping to capital of Kazakhstan - Astana?

    • @AntonsMindstorms
      @AntonsMindstorms  2 месяца назад +1

      I added Kazakhstan as a destination. Thanks for asking.

    • @Erlan004
      @Erlan004 2 месяца назад

      Thank you 😊​@@AntonsMindstorms

    • @Erlan004
      @Erlan004 2 месяца назад

      I bought from your website, I received a message in the mail, but there is no information about the order on your website. My order is number 8613

    • @AntonsMindstorms
      @AntonsMindstorms  2 месяца назад

      @@Erlan004 It's best to reply to that message you received, then I can track and send you an update.

  • @RomanRichter420
    @RomanRichter420 3 года назад +1

    Do you ship worldwide? :D

    • @AntonsMindstorms
      @AntonsMindstorms  3 года назад +1

      Currently us, eu and Brazil. In what country do you live?

    • @RomanRichter420
      @RomanRichter420 3 года назад

      @@AntonsMindstorms Russia

    • @AntonsMindstorms
      @AntonsMindstorms  3 года назад

      I added Russia to my website now. I'm also investigating cheaper methods to ship internationally.

  • @collozizou
    @collozizou 4 месяца назад

    HELP ME !!

  • @collozizou
    @collozizou 4 месяца назад

    [Errno 19] ENODEV While writing pyhuskylens.mpy[Errno 19] ENODEV While opening file for hash check.Traceback (most recent call last): File "install_mpy_robot_tools", line 67, in NameError: name 'hash_check' isn't defined ??????

  • @collozizou
    @collozizou 4 месяца назад

    [Errno 19] ENODEV While writing pyhuskylens.mpy[Errno 19] ENODEV While opening file for hash check.Traceback (most recent call last): File "install_mpy_robot_tools", line 67, in NameError: name 'hash_check' isn't defined !!!!