Git Product home page Git Product logo

cotekinverter's Introduction

CotekInverter

A library to controll cotek inverter with using arduino in RS232 serial communication.

Requirement

Please install SomeSerial library via library manager.

https://github.com/asukiaaa/SomeSerial

Connection between Cotek Inverter and Arduino

Role of modular pins from Cotek Inverter is like this.

Pins Role
1 Not used
2 GND
3 RXD
4 TXD
5 Remo Control
6 VCC

You can connect the pins to arduino like this.

  • RXD -> RS232 level converter -> Arduino TX
  • TXD -> RS232 level converter -> Arduino RX
  • Remo Control -> Arduino GND
  • GND -> Arduino GND

Useage

Include

#include "CotekInverter.h"

Definition

With HardwareSerial

CotekInverter intevter(&Serial);

For Lonardo HardwareSerial

CotekInverter inverter(&Serial1);

With SoftwareSerial

CotekInverter inverter(8, 9); // RX, TX

Please define with rx and tx pins.

Power off

inverter.powerOff();

You can trun off the inverter.

Power on

inverter.powerOn();

You can turn on the inverter.

Example

#include "CotekInverter.h"

int SWITCH_PIN = 14;

CotekInverter inverter(&Seral);

void setup() {
  pinMode(SWITCH_PIN, INPUT);
  inverter.powerOff();
}

void loop() {
  if ( digitalRead(SWITCH_PIN) == HIGH ) {
    inverter.powerOn();
  } else {
    inverter.powerOff();
  }

  delay(1000);
}

License

MIT

References

Cotek Inverter manuals: https://github.com/asukiaaa/CotekInverterDocuments

cotekinverter's People

Contributors

asukiaaa avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.