![]() Then connect the Vout pint to analog pin 0 on your Arduino. Install a LM35 with +5V and GND as per the datasheet, pins change with packages. Now for the Arduino, all you need to do is upload this code to your Arduino. Settings to save, make sure you point to this file in the AppleScript #Quit CoolTerm, I left this out to begin with and it cause the CoolTerm window to stay open EWW #Disconnect from the xBee, always disconnect or you might have problems reconnecting later! #Display an alert containing what the Arduino sent to us #Say dataIn using the computers built in Text to Speach #Read all the characters in the buffer into dataIn #Get all the character out of the buffer ready for reading #Wait 1 second to allow for the full string to be sent for the Arduino #Write a single character to the Arduino with the temp sensor I sent a ‘U’ #Display an alert if the connection failedĭisplay alert “Failed at connecting to xBee” #Display an alert if the connection opened #Try and connect to the xBee using the settings loaded #Display an alert if the settings did not loadĭisplay alert “Failed at loading settings.” #Display an alert if the settings loaded correctly If LoadSetting (“Macintosh HD:Users:ashleyhughes:Documents:CoolTerm:xBeeConnection.stc”) then #The file to a folder in my documents, you will need to do this and point to the #Was open CoolTerm set the serial port I wanted to use in the options and saved #Load settings from where I saved then before hand see pictures below My AppleScript ended up looking like this (Comments added for your information) Now I added in some more code to display alerts when I made things happen so I could see if it was working. Quit – Quit CoolTerm to make the window disappear.Disconnect – Close the connection to the xBee. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |