Hello, guys.
This is my first post here. Great platform, great community!
I am new in arduino world, but have some programming knowledge. Normally use autoit script - basic like language for automization. And ofcourse look for the best way to connect arduino with Autoit, BUT THIS TOPIC IS NOT ABOUT AUTOIT!!
. Serial communication is simple, but not for me :). I already establish some connection, but have an idea how to do some control simpler.
The idea is simple: command line tool - just run it with some parameters and it control the pins on arduino. I know this will never be a powerfull tool as is the arduino language, but will help a lot of people to control arduino project without any arduino programming, using their favorite language.
Some examples commands:
comduino digitalWrite 10 HIGH
comduino digitalWrite A3 LOW
comduino analogRead 5
comduino digitalRead 5
You see I try to keep it close to the original commands. This is a basic communication between pins on arduino and a PC. Someday may have other functionality as servo control, etc, but the close target is to get these 3 simple commands to work.
How I can see the program part:
- command line based tool (comduino is a good name I think) - you just send parameters to the exe (sorry I am windows user, but this tool can have alternatives on other platforms too), comduino converts and send this information to arduino using serial connection.
- Arduino code who listen the serial, get the commands and just do what they say.
If you have this combination you can just buy a board, put some sensors, leds, etc, just upload the arduino code and program everything on your favorite language.
If there is already a tool with this functionalaty - just give me a link.
I already start some work for it. You can see the Autoit code and autoit topic here: arduino command line tool - AutoIt General Help and Support - AutoIt Forums I don't expect to give me info about autoit part, ofcource.
Honestly I don't have idea how to send the variables in way that arduino to see them properly and to react.
I have some Arduino code too, but It just don't work so far :). Maybe will help you to get my point and will help me to fix it ;):
int command=2;
int pin=9;
int writebyte=1;
int pinType = 1;
int dread = 0;
void setup()
{
Serial.begin(9600);
}
int i=0;
void loop()
{
if (Serial.available() > 0) {
// incomingByte = Serial.read();
if (command==1){
pinMode(pin,OUTPUT);
dread = digitalRead(pin);
Serial.println(dread);
};
if (command==2){
Serial.write("kur");
pinMode(pin,INPUT);
if (writebyte == 0) {
digitalWrite(pin,LOW);
Serial.print("LOW was write on pin ");
Serial.println(pin);
};
if (writebyte == 1) {
digitalWrite(pin,HIGH);
Serial.print("HIGH was write on pin ");
Serial.println(pin);
};
};
};
delay(1000);
};
Thank you for your attention.