3a7d4a72b0e0aec439c2c27368e4be500c241d1c,Software/Scratch/GoPiGo3Scratch.py,,handle_light,#Any#,491

Before Change



    if known_sensors[port] == None or \
       isinstance(known_sensors[port], easy.LightSensor) is False:
        try:
            // print("Instancing Light Sensor")
            known_sensors[port] = easy.LightSensor(port,gpg)
        except Exception as e:
            print("handle_light {}".format(e))
            return ({"{}: Light".format(port):"technical difficulties"})
            
    // print("Reading from port {}".format(port))

    light_reading = known_sensors[port].percent_read()    
    sensors["{}: Light".format(port)] = light_reading
        
    return sensors

After Change


    light = get_sensor_instance(port, easy.LightSensor)
    
    if light:
        light_reading = light.percent_read()    
        sensors["{}: Light".format(port)] = light_reading
    else:
        return ({"{}: Light".format(port):"technical difficulties"})
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: DexterInd/GoPiGo3
Commit Name: 3a7d4a72b0e0aec439c2c27368e4be500c241d1c
Time: 2017-06-19
Author: cleoqc1124@gmail.com
File Name: Software/Scratch/GoPiGo3Scratch.py
Class Name:
Method Name: handle_light


Project Name: DexterInd/GoPiGo3
Commit Name: 34f548f677a8575a21dccadea82bc1d46e5a05b1
Time: 2017-05-05
Author: cleoqc1124@gmail.com
File Name: Software/Python/Examples/easy_Light_Sensor.py
Class Name:
Method Name:


Project Name: DexterInd/GoPiGo3
Commit Name: 676cc5c95a9d4643aafdb5f0854815154037ea4f
Time: 2017-06-17
Author: cleoqc1124@gmail.com
File Name: Software/Scratch/GoPiGo3Scratch.py
Class Name:
Method Name: handle_light