📜 ⬆️ ⬇️

yet another serial protocol, for people

Almost every owner of arduino is faced with the task of controlling its pins on a signal from a computer, and almost everyone writes his own program in which reading is Serial, and switch with actions.
Once I got tired of compiling something for every sneeze and I got another small, simple, human-like and script-oriented protocol.


Download: svn checkout http://avros.googlecode.com/svn/trunk/ avros
compile and upload avros.pde

Open the com port in any way and write there:
w13,1
and we have digitalWrite (13,1), or
W10,100 analogWrite (10,100)
r10 digitalRead (10) - the result will return as r10,1
R14 analogRead (14) - R14,42
d100 delay (100)
and almost all the other functions, more inside avros.h
in numbering analog pins immediately after digital ones, 14-21 on small ones and 54-69 on megs
')
The separator between the teams can be used any convenient for example:
w13,1 d500w13,0 ;-) d100; w13,1

You can write a sequence in the eprom, and execute from it in a loop or one-time:
E o w13.1 d1000 w13.0 d1000 OSE es

Decorated as a single .h file, you can attach it to any program, for example: avros.pde

Flowing bun: you can send commands directly from the command line of any OS directly to the port, without forgetting to adjust the speed, you can connect via a terminal like putty or minicom, or from any script in any language (example in one esoteric language included)

Yes, about Firmata with a binary protocol and a Bitlash monster that will take all the memory on a 168 chip, I know.

Ready to saw the missing functions, you can from the standard libraries.

Source: https://habr.com/ru/post/119481/


All Articles