Jump to content
Issues with Images is known, we are working on it. ×

Recommended Posts

Posted

This post to share some MODdings that can be done to the Powered Up Android APP interface (Create mode with controller). I searched the forum but didn't find a similar post.

With the actual version, it's possible to change the size and positions of the widgets, and mix on the same interface the widgets of the 2 controllers

It's even possible to add the widgets of the Play mode controllers (Te trains and Batman), and access more code blocks.

So theorically, it should be possible to control several trains/cars with one interface.

After creating a new project with controller, go to "/android/data/com.lego.common.poweredup/files/Activities/<xxxxxxxx>/" to find the associated files (if you open the metadata.json file you can verify in the "name" if it's the right project)

In the "playCanvas.json" file there's all the actual widgets, identified by their "widgetId", with their positioning informations. It's then possible to add/modify them, and restart each time the App to see the results. To find out the widgetId, you can create a new project with the other controller and open it's "playCanvas.json" file (the positioning should hint on the concerned widgets).

To exploit the added widgets, we need their associated code blocks. For that, in the powered-up-metadata.json file, replace the "Controller" value by "00000000-0000-0000-0000-000000000000". Thus, the palette.json file will be used to display the needed code blocks by replacing "/widgets/widget-(.+)-block-(5[5-9])" or "/widgets/widget-(.+)-block-(3[7-8])" by "/widgets/.*"

The App has to be restarted after the modifications.

To go further and use the Play mode widgets, you can search the widgetId in their playCanvas.json files at "/android/data/com.lego.common.poweredup/files/PredefinedActivities/<xxxxxxxx>/" and change the playCanvas.son as above, and do those modifications in the "palette.json" file :
- add the following at the end of "TabDefinitions" :
    {"Name": "Dev", "HexColor": "CompositeBlock3"}
This will add  new category "Dev" in the code blocks
- in "contents", disable all the blocks with "null", and add the following at its end :
    {"Field": "TypeName", "Value": ".*", "Tab": "Dev"}
After App restart, a new tab (red) will appear with new code blocks. The ones to use has the same icons as the global variables but are orange with a red "P" written on them. The parameter to use is the widgetId.

Don't consider this as a tutorial as it needs some clarifications and I surely miss other informations. Also, this may not work with the comming versions of the App

Posted
1 hour ago, Ast7 said:

 and do those modifications in the "palette.json" file :

- add the following at the end of "TabDefinitions" :
    {"Name": "Dev", "HexColor": "CompositeBlock3"}
This will add  new category "Dev" in the code blocks
- in "contents", disable all the blocks with "null", and add the following at its end :
    {"Field": "TypeName", "Value": ".*", "Tab": "Dev"}
After App restart, a new tab (red) will appear with new code blocks. The ones to use has the same icons as the global variables but are orange with a red "P" written on them. The parameter to use is the widgetId.

Don't consider this as a tutorial as it needs some clarifications and I surely miss other informations. Also, this may not work with the comming versions of the App

Thx, the Dev Tab was new tor me =)

So multiple guys all around the world thought the same thing.. xD

 

You can easily add all available widgets to the GUI and use it. There are also code blocks for absolute positioning for the technic motors, "port scanning" etc...

One thing that I was unable to get up and running: same widget several times with different channels. That would solve a lot of problems.

Posted
58 minutes ago, Gimmick said:

You can easily add all available widgets to the GUI and use it. There are also code blocks for absolute positioning for the technic motors, "port scanning" etc...

One thing that I was unable to get up and running: same widget several times with different channels. That would solve a lot of problems.

Yes, some blocks could be interesting for advanced coding (didn't test them yet)

I also tried to add the same widget but it was just ignored. Even Lego used 2 different widgets for sliders with the design, so may be it's not possible

  • 2 weeks later...
Posted

Does anyone know what the orange "generic IO something" with 3 inputs does?

It seems to read data from the ports: (A,3,0) is something like the angular motor position from the motor on port A. But what are the possible inputs here?

Posted
9 minutes ago, GianCann said:

@Gimmick can you give me a picture of this block?

screenshot_20200720-121km0.jpg

The orange/right one.

Ignore the "-1", I just took a screenshot without connecting anything.

Posted
3 hours ago, Gimmick said:

Does anyone know what the orange "generic IO something" with 3 inputs does?

First par: Port

Second par: Mode (each device has many mode)

Third par: I think that is the dataset. Some sensor, like the Color and Distance sensore return more than one single value with some mode. I need to investigate better.

Take a look here:

https://github.com/pybricks/technical-info/blob/master/uart-protocol.md

 

Posted

@GianCann

Thank you :)

So for XL motor on Port A:

A,1,0 = speed

A,2,0 = angle

A,3,0 = abs angle <- strange values

I realy hope there will be a new PU version directly on august 1. atleast with support for the new "angular motor" in the 42114 :<

  • 2 weeks later...
Posted

Hmm, does anyone else has the effect, that new PU-profiles are not visible in ...\Activities anymore?

If I create and paste a profile I created by hand it still shows up in PU, but if I create a new profile in the PU-App nothing new is visible in the windows file explorer. Even a search for new files shows nothing.

Posted

Hi,

What do you mean: "Profile"? A program newly defined under "Create"?
They are still there, but all changes (add, delete) aren't  visible without disconnecting and reconnecting USB (Samsung Galaxy Tablet)

 

Posted

@Lok24

omg... you are right :D

I refreshed everything, reconnected the device in my "PU-Profilemanager",... but did not reconnect the USB... :blush:

  • 1 month later...
Posted

In V 3.4.0 is a new predefined activity "custom control" with a new grid-background and a teasing thumbnail.

No functionality currently, but it seems that next release might be interesting.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...