You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was messing around with the BOOST Color Distance Sensor and Power Functions Infrared Receiver, using the sensor's infrared emission mode to talk to the receiver (You can find documentation on this here). While it's cool that this is even possible, it only works one way, which means that I can't use the Power Functions remote with any Powered Up hubs. But, while I was testing this question, I found something interesting:
sensor.ambient() somehow detects infrared light? In a dark room with an ambient value of 0 (basically pitch black to the sensor), pressing one of the buttons on the IR remote while pointing it at the sensor spikes the ambient readings. This also happens in a wave, like so:
0 (Dark room ambience)
0
...
0
0 (Pressed remote button)
12
30
36
35
29
24
16
9
3
0
0 (Still holding down remote button)
0
0
0
0
0
0
14 (Notice how these numbers are quite similar to the first wave?)
34
41
40
37
30
24
15
6
2
4
0
0
0
0 (Still holding down remote button)
...
Now, since I only have the LEGO Boost Color Distance Sensor, I can't confirm that it works on the Lego Education SPIKE Color Sensor. If anyone else has it, I'd love to know your results with this! I used this code for the results above:
frompybricks.hubsimportTechnicHubfrompybricks.pupdevicesimportColorDistanceSensorfrompybricks.parametersimportPortfrompybricks.toolsimportwaithub=TechnicHub() # You can use any hub thoughsensor=ColorDistanceSensor(Port.A)
# Best results in a room with natural ambience of 0, a.k.a darkwhileTrue:
print(sensor.ambient())
wait(10)
# You can use other sampling rates like 5 or even 1 ms for more accurate results# 10 works well as a proof of concept, though
I do wonder whether this can be used to read remote values of the Power Functions remotes? If so, that would be really cool and would enable communication both ways. I haven't tested whether the actual wave values differ greatly based on which button is pressed (ex: right vs left), but I'd expect them to be different. If it's possible to differentiate them, maybe this could be a way to communicate between Powered Up and Power Functions.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I was messing around with the BOOST Color Distance Sensor and Power Functions Infrared Receiver, using the sensor's infrared emission mode to talk to the receiver (You can find documentation on this here). While it's cool that this is even possible, it only works one way, which means that I can't use the Power Functions remote with any Powered Up hubs. But, while I was testing this question, I found something interesting:
sensor.ambient()somehow detects infrared light? In a dark room with an ambient value of 0 (basically pitch black to the sensor), pressing one of the buttons on the IR remote while pointing it at the sensor spikes the ambient readings. This also happens in a wave, like so:Now, since I only have the LEGO Boost Color Distance Sensor, I can't confirm that it works on the Lego Education SPIKE Color Sensor. If anyone else has it, I'd love to know your results with this! I used this code for the results above:
I do wonder whether this can be used to read remote values of the Power Functions remotes? If so, that would be really cool and would enable communication both ways. I haven't tested whether the actual wave values differ greatly based on which button is pressed (ex: right vs left), but I'd expect them to be different. If it's possible to differentiate them, maybe this could be a way to communicate between Powered Up and Power Functions.
All reactions