Hello. I've been trying to get ASproxy to work in conjunction with my ardiuno.
I have ASproxy which will read the serial, and if a '1' comes up, it should execute a python script I have that deletes the emails in my Gmail account.
The problem I'm having is that while the arduino program is open, ASproxy cannot communicate with the serial because arduino is accessing the serial. Its the same the other way round. I need the program to be running for my code to work.
Can anyone help me?
My code on the arduino if it helps is:
(The code puts on an LED if I have emails, and prints a '1' when I press a button on the arduino)
// led wired + to pin 12, resistor to positive +5v
int outPin = 12; // Output connected to digital pin 12
int mail = LOW; // Is there new mail?
int val; // Value read from the serial port
int inPin = 6; // choose the input pin (for a pushbutton)
int val2 = 0; // variable for reading the pin status
void setup()
{
pinMode(outPin, OUTPUT); // sets the digital pin as output
Serial.begin(9600);
Serial.flush();
//mail = HIGH; // start off with lights out
pinMode(inPin, INPUT); // declare pushbutton as input
}
void loop()
{
//if (val2 == HIGH)
//if (val == 1)
// Read from serial port
if (Serial.available())
{
val = Serial.read();
Serial.println(val, BYTE);
if (val == 110) // n = 110 in dec
{
mail = LOW; // HIGH is off because led is connected to +5v on the other side
}
else if (val == 109) //109 = m in dec
{
mail = HIGH; // LOW is on because led is connected to +5v on the other side
}
val2 = digitalRead(inPin); // read input value
Serial.println(digitalRead(val2));
val = Serial.read();
}
// Set the status of the output pin
digitalWrite(outPin, mail);
}