Skip to content
This repository was archived by the owner on Aug 13, 2019. It is now read-only.
This repository was archived by the owner on Aug 13, 2019. It is now read-only.

Get TCS3200 Color Sensor working #22

Description

@omn0mn0m

see ultrasonic sensor nanpy class and nanpy-firmware classes for implementation help

Convert the Arduino class written by @bwall72 to a Nanpy class. This involves writing empty pass functions in Python, then a nanpy-firmware ArduinoObject that accepts those empty functions and returns a value.

The following classes should be written:

  • colorsensor.py
  • ColorSensorClass.cpp
  • ColorSensorClass.h
  • ColorSensorWrapper.cpp
  • ColorSensorWrapper.h

To test this sensor, create a colour sensor in the Drivetrain subsystem. Give it a function and test if it works. Something like this:

Drivetrain class

self.color_sensor = ColorSensor(pins)

def is_on_blue(self):
    return self.color_sensor.has_blue()

firefighter.py

while (True):
    # Other subsystem commands
    print "Sensor reads blue: {0}".format(drivetrain.is_on_blue())

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions