Replies: 1 comment 4 replies
-
|
You could move the logic of what the motor should do to the hub with the color sensor and then just send the speed the motor should go instead of sending the color. Contraptions tend to work better when most of the logic is on one hub and the other hubs just act as remote inputs and outputs. But if you really want to send the color, you can use an "if" block to convert the color to a string, e.g. if color sensor color == red, then color_name = "red" else color_name = "green". Or if you want the actual color information, you can use an "unpack" block to unpack the color into three variables for the component parts (hue, saturation and value). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
The students have encountered a problem, but unfortunately I can't help them. Color sensor (plug C) on Boost_hub detects red or green color. The data (red or green) needs to be sent to the next hub (Spike), where it needs to run motor_1 (green color) or motor_2 if red color was detected. We couldn't find the right blocks to transfer data from Boost to Spike. If, for example, we use a reflection instead of color, there is no problem. Does anyone have an idea how to do it ? Studens are younger (8-10) so we use Py-bloks.
Thank´s in advance
B.
Beta Was this translation helpful? Give feedback.
All reactions