Devices & Components
Arduino Mega 2560 Rev3
MST_K17 board
Project description
Code
MST_K17 code
arduino
1/* ITA 2Codice per pilotaggio dell'interruttore optoelettronico MST_K17. 3 4Collegando il pin CNT=53 all'ingresso positivo del modulo MST_K17 5e l'ingresso 6 negativo alla GND della scheda Arduino( MEGA) 7accendera' e spegnera il carico 8 tramite il modulo MST_K17 per un tempo ( in millisecondi) settati con la variabile 9 dly 10Come carico del MST_K17 si puo usare una lampada. un motore o un riscaldatore 11*/ 12 13/* 14 ENG 15Simple code for driving the optoelectronic AC relay MST_K17. 16Connecting 17 the pin CNT=53 at the positve input of the MST_K17 18and its negative input to 19 the GND of the Arduino board (MEGA) 20the load will be turn on / off by the MST_K17 21 module for a time ( in milliseconds) set by the variable dly 22As load of the 23 MST_K17 you can use a lamp, motor or heater. 24*/ 25 26// set pin numbers: 27const 28 int CNT = 53; // the number of the CNT pin 29 30 31// variables will change: 32 33int 34 dly=100; // tempo di ON e OFF del modulo 35 36void setup() { 37 38 pinMode(CNT, 39 OUTPUT); // CNT pin as an output: 40 41} 42 43void loop() { 44 45 digitalWrite(CNT,HIGH); 46 47 delay(dly); 48 digitalWrite(CNT,LOW); 49 delay(dly); 50 51} 52
MST_K17 code
arduino
1/* ITA 2Codice per pilotaggio dell'interruttore optoelettronico MST_K17. 3Collegando il pin CNT=53 all'ingresso positivo del modulo MST_K17 4e l'ingresso negativo alla GND della scheda Arduino( MEGA) 5accendera' e spegnera il carico tramite il modulo MST_K17 per un tempo ( in millisecondi) settati con la variabile dly 6Come carico del MST_K17 si puo usare una lampada. un motore o un riscaldatore 7*/ 8 9/* ENG 10Simple code for driving the optoelectronic AC relay MST_K17. 11Connecting the pin CNT=53 at the positve input of the MST_K17 12and its negative input to the GND of the Arduino board (MEGA) 13the load will be turn on / off by the MST_K17 module for a time ( in milliseconds) set by the variable dly 14As load of the MST_K17 you can use a lamp, motor or heater. 15*/ 16 17// set pin numbers: 18const int CNT = 53; // the number of the CNT pin 19 20 21// variables will change: 22 23int dly=100; // tempo di ON e OFF del modulo 24 25void setup() { 26 27 pinMode(CNT, OUTPUT); // CNT pin as an output: 28 29} 30 31void loop() { 32 33 digitalWrite(CNT,HIGH); 34 delay(dly); 35 digitalWrite(CNT,LOW); 36 delay(dly); 37 38} 39
Downloadable files
MST_K17 arduino driving example
MST_K17 arduino driving example

Comments
Only logged in users can leave comments