Versionen im Vergleich

Schlüssel

  • Diese Zeile wurde hinzugefügt.
  • Diese Zeile wurde entfernt.
  • Formatierung wurde geändert.

A special circuit pushes the current through the emitting diode up to 0.5A for the duration of a pulse of approximately 100µs. 


Panel
borderColor#FFFFFF
bgColor#e6b3cc
titleColorblack
titleBGColor#cc6697
titleCircuit Diagram
  • Circuit for using with Python 
    View file
    nametcrt1000-modul-schema.pdf
    height150
  • Circuit for using with Java     
    View file
    nametcrt1000-modul-schema1.pdf
    height150
Panel
borderColor#FFFFFF
bgColor#a7d5c2
titleColorblack
titleBGColor#1cae8d
titleData Sheet

Usage Zynq7000

To use the module with the Zynq7000 together with https://flink-project.ch/, you need a Reflective Photoelectric Sensor subdevice within flink. Connect it in the following way:

Microzed BoardModule
L14Trig
N16A0
L15A1
ADC7476Out

The sensor output has to be digitized by a ADC. Our Microzed adapter board for our experimental system already has an AD7476 incorporated for this purpose.

There are two drivers available. One for Python when using a Linux operating system and one for Java in combination with deep




Python Example

Codeblock
languagepy
firstline1
title
LCDExample
TCRT1000Example.py
linenumberstrue
import 
driver import time
flink

# init LCD disp
tcrt1000 = 
driver
flink.
HD44780U
FlinkReflectiveSensor()
disp.init(2) # write to display a = 87103 disp.writeString(str(a)) disp.setCursor(1,5) disp.writeChar('A') disp.writeChar('x') time.sleep(3) # clear display disp.clearDisplay() # turn on display and turn off blinking and cursor disp.onOff(True, False, False
while True:
    print("TCRT1000: value =", sense.getValue(0))


Java Example

Codeblock
languagejava
firstline1
titleLCDExample.java
linenumberstrue
import java.io.PrintStream;

import org.deepjava.runtime.arm32.Task;
import org.deepjava.runtime.zynq7000.driver.
HD44780U
TCRT1000;
import org.deepjava.runtime.zynq7000.driver.UART;

public class TCRT1000Demo extends 
CharLCDTest
Task {
	
	static 
HD44780U
TCRT1000 
disp
sense;
	
	public
static
 void 
dispOff
action() {
		
disp.onOff(false, true, true); } public static void dispOn(
for(int i = 0; i < 4; i++) {
			
disp.onOff(true, true, true
System.out.print(sense.read(i));
		
} public static void writeT() { disp.writeChar('T'
	System.out.print('\t');
		}
		System.out.println();
	}
	
	static {
		
public
UART 
static
uart 
void
= 
writeInt() {
UART.getInstance(UART.pUART1);
		
disp.writeInt(8635, 6
uart.start(115200, (short)0, (short)8);
	
} public static void writeLn() { disp.writeLn(); } public static void clearDisplay() { disp.clearDisplay
	System.out = new PrintStream(uart.out);
		System.err = System.out;
		System.out.println("TCRT1000 demo");
		
		// Initialize TCRT1000 driver for 4 sensors and start reading values
		sense = TCRT1000.getInstance();
	
} public static void setCursor() { disp.setCursor(1, 4); } static { disp = HD44780U.getInstance(); disp.init(2
	sense.init(4, 4, 3, 2, 1, 0); // initialize 4 sensors
		sense.start();
		
		// Create and install demo task
		Task demoTask = new TCRT1000Demo();
		demoTask.period = 1000;
		Task.install(demoTask);
	}

}