Announcement

Collapse
No announcement yet.

How to Create Custom I2C Driver for Blocks

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • FTC7048
    started a topic How to Create Custom I2C Driver for Blocks

    How to Create Custom I2C Driver for Blocks

    I am new to Blocks and was wondering if it is possible to create a custom I2C driver for Blocks? You can do it in Java and is very useful for adding some of the adafruit sensors.

    Thanks

  • NoahAndrews
    replied
    It being crossed out just means the option may go away in the future, but it most likely will stick around in this case. I think we might get rid of the crossout for that option.

    Unfortunately, Blocks does not support programming raw I2C devices at this time. There is absolutely no way to use that device in Blocks without a lot of knowledge and a modified version of the app, which would not be legal for competition use.

    Leave a comment:


  • Z8695
    replied
    Originally posted by 3805Mentor View Post

    I see a MR color sensor as an option in our config menu. Did you see a scroll bar?
    Right, We have used that before. The team wants to have a multicolored visible light source on the robot. The Color Beacon is different than the color sensor.

    Leave a comment:


  • 3805Mentor
    replied
    Originally posted by Z8695 View Post
    I have a similar question. The middle school team I mentor programs with Blocks Programming and uses solely modern robotics electronics. They want to use a Modern Robotics I2C color beacon as a signal to assist drivers in the teleop stage of the competition.

    I do not see an option to configure the robot with the MR Color Beacon. So I'm guessing that it would have to be treated as an I2C device. When I configure that as a port on the configuration tool, it allows that selection, but is just crossed out. See image.

    Screenshot_20181212-222835.png

    Then in blocks programming, I would expect to see something to control a generic I2C device with an address/data command. However, nothing like that is available. Are we simply out of luck because we are using blocks programming?

    I know that the core device interface also supports internal LEDs that can be programmed. However, I assume that these would require I2C commands as well since I don't see any options to control the Coder Device Interface.

    I believe that we had the ability to control an I2C device in previous versions of blocks programming - but maybe that was in app inventor.
    I see a MR color sensor as an option in our config menu. Did you see a scroll bar?

    Leave a comment:


  • Z8695
    replied
    I have a similar question. The middle school team I mentor programs with Blocks Programming and uses solely modern robotics electronics. They want to use a Modern Robotics I2C color beacon as a signal to assist drivers in the teleop stage of the competition.

    I do not see an option to configure the robot with the MR Color Beacon. So I'm guessing that it would have to be treated as an I2C device. When I configure that as a port on the configuration tool, it allows that selection, but is just crossed out. See image.

    Screenshot_20181212-222835.png

    Then in blocks programming, I would expect to see something to control a generic I2C device with an address/data command. However, nothing like that is available. Are we simply out of luck because we are using blocks programming?

    I know that the core device interface also supports internal LEDs that can be programmed. However, I assume that these would require I2C commands as well since I don't see any options to control the Coder Device Interface.

    I believe that we had the ability to control an I2C device in previous versions of blocks programming - but maybe that was in app inventor.

    Leave a comment:


  • NoahAndrews
    replied
    You are definitely not going to be able to write the driver in blocks.

    If you write a driver in Java, I'm pretty sure you can use it from blocks if it implements a pre-existing hardware interface that can be used from blocks. For example, if it implements DistanceSensor, you should be able to use it with the distance sensor block.

    Adding new blocks is not able to be done by users at this time.

    Leave a comment:

Working...
X