Hello, this is my first post because i could not find anything for my solution anywhere else, so i recur to direct helpline
My problem is that I can not manage to get the information from a tilt sensor an my Arduino into Applescript.
Applescript compiles the script with no errors but then the whole program crashes.
I have downloaded and installed SerialPort X correctly.
I think the problem is either in the Applescript script:
set portRef to serialport open "/dev/tty.usbmodem411" bps rate 9600 data bits 8 parity 0 stop bits 1 handshake 0
if portRef is equal to -1 then
display dialog "Could not open serial port" buttons {"Cancel"} default button 1
else
serialport read portRef
end if
OR I must tell that i have used Processing to interpret information from the same setup I currently working with without any issues.
The only small detail is that processing reads in Bites, so the information from Arduino is set to be sent sent as BYTE :
Serial.print(2, BYTE);
So the Precessing console wrote 2 when the tilt sensor was HIGH.
Could this be the a possible problem?
Thank you very much!
R