nzin / xpressnet_arduino Goto Github PK
View Code? Open in Web Editor NEWA Xpressnet protocol implementation for Arduino Mega 2560
A Xpressnet protocol implementation for Arduino Mega 2560
Introduction ============= This is a basic xpressnet arduino implementation. My goal was to create my own switch remote controller, so it implements only what I was looking for, but it is very easy to add features. There is video (in french) of what I'm trying to do at http://youtu.be/JcD7iC3VbOw Arduino Mega ============ You need an Arduino Mega 2560. Why? because xpressnet is a 9bit serial protocol. Standard Arduino SDK don't provide 9bits. But someone reimplement a 9bit Serial library (I put it into the arduinoSdk directory). So you need to take HardwareSerial.h and HardwareSerial.cpp and replace these in the Arduino SDK (in /hardware/arduino/avr/cores/arduino/), and of course select Arduino 2560 in the Arduino IDE (in Tools/Board) Wiring ====== You will need a Max485cpa chip, and pay attention to the wiring image provided. I'm a bit confused on the RJ12 where is the GND and where is the VCC. Also, there is a sense between A and B. If not in the correct position, my program don't decode it properly (I guess bits arrived in the reverse state, i.e. 1 is seen as 0 and 0 is seen as 1). In brief: I don't have code a "auto-reverse". Code ==== When everything is in place, you can use the code. Mine currently is used to switch every 2 seconds a turnout (its id on my lockmauss is 38, and in the code, it is 37, because human counts from 1.. and computer begins to count from 0) The "architecture" is the following: - decodeXpressnet will read on a serial device data coming from xpressnet (via rs485), and will use decodeStage2 to decode data payload. - if it is a "normal inquiry" message, poolEvent() will be called. - poolEvent will check the XpressCommand stack state. If there is something, it will pop up one XpressCommand from the stack and send it. - in your other part of the code, when you want to emit a command, you need to * create it: XpressCommand c = new XpressCommand() * populate it : c->pushData(0x21); c->pushData(0x81); * put it on the queue: XpressCommand::pushStackCommand(stack,c); Hope it can help! Nicolas Zin ([email protected])
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.