Examples of ColorSensor


Examples of components.features.sensor.color.ColorSensor

          {
            Color color = new Color(Integer.valueOf(colors[0]).intValue(),
                        Integer.valueOf(colors[1]).intValue(),
                        Integer.valueOf(colors[2]).intValue());
           
            featuresHash.put( fields[0].trim() , new ColorSensor("", "", color) );
          }
        }
        else
        {
          // Sensor B/W
View Full Code Here

Examples of components.features.sensor.color.ColorSensor

          {
            Color color = new Color(Integer.valueOf(colors[0]).intValue(),
                        Integer.valueOf(colors[1]).intValue(),
                        Integer.valueOf(colors[2]).intValue());
           
            featuresHash.put( fields[0].trim() , new ColorSensor("", "", color) );
          }
        }
        else
        {
          // Sensor B/W
View Full Code Here

Examples of lejos.nxt.addon.ColorSensor

public class ColorDetector {

  final static int INTERVAL = 200; // milliseconds
 
  public static void main(String [] args) throws Exception {
    ColorSensor cmps = new ColorSensor(SensorPort.S1);
    String color = "Color";
    String r = "R";
    String g = "G";
    String b = "B";
   
    while(!Button.ESCAPE.isPressed()) {
      LCD.clear();
      LCD.drawString(cmps.getProductID(), 0, 0);
      LCD.drawString(cmps.getSensorType(), 0, 1);
      LCD.drawString(cmps.getVersion(), 9, 1);
      LCD.drawString(color, 0, 3);
      LCD.drawInt((int)cmps.getColorNumber(),7,3);
      LCD.drawString(r, 0, 5);
      LCD.drawInt((int)cmps.getRedComponent(),1,5);
      LCD.drawString(g, 5, 5);
      LCD.drawInt((int)cmps.getGreenComponent(),6,5);
      LCD.drawString(b, 10, 5);
      LCD.drawInt((int)cmps.getBlueComponent(),11,5);
      LCD.refresh();
      Thread.sleep(INTERVAL);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.