9414 views|0 replies

422

Posts

4

Resources
The OP
 

Toshiba Photorelay Review #2 Application of TLP3547 in Project [Copy link]

 This post was last edited by Beifang on 2018-10-11 16:33 Application in the project1.The basic component evaluation of TLP3547 only explains the application scheme. It should be more convenient to apply it in practical projects. 2. Here we first use the Blink program, Use digital output to control the input, so that the LED light can be lit. Arduino program code is as follows;
  1. // the setup function runs once when you press reset or power the board void setup() { // initialize digital pin LED_BUILTIN as an output. pinMode(LED_BUILTIN, OUTPUT); } // the loop function runs over and over again forever void loop() { digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second }
复制代码
The video is as follows VID_20181011_154315.mp4 (4.61 MB, downloads: 0) 3. Then use the distance sensor to start the lighting and closing of the LED, etc.,
  1. void setup() { // initialize serial communication at 9600 bits per second: Serial.begin(9600); pinMode(LED_BUILTIN, OUTPUT); } // the loop routine runs over and over again forever: void loop() { // read the input on analog pin 0: int sensorValue = analogRead(A0); // Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V): float voltage = sensorValue * (5.0 / 1023.0); // print out the value you read: Serial.println (voltage); if (voltage <3) { digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); } if (voltage > 3) { digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW delay(1000); } }
复制代码
The video is as follows VID_20181011_160127.mp4 (8.12 MB, downloads: 1)







 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list