Jump to content

1 post in this topic

Recommended Posts

Hello,

 

I am using the SerialPortX add-on for applescripts. Basically what I want is for the script to control volume on my mac based on output from an Arduino (thus the need for SerialPortX). 

 

The output from Arduino is sent as characters. As of right now, the letter "A" is sent form the Arduino to the computer to increase the volume and the number "0" to decrease Volume. The characters themselves can be changed, but I will need to add a few more characters to increase functionality (play/pause, next song, previous song, etc). 

 

I need help/the code on how to read the output from the Serial port. Thanks in advance

 

 

 

set use_port to "/dev/cu.usbserial-AE01EC89"

 

on idle

if (get serialport list) contains use_port then

set myPort to serialport open use_port bps rate 9600 data bits 8 parity 0 stop bits 1 handshake 0

if myPort ≠ -1 then -- check the port opened correctly

 

 

 

 

 

serialport close myPort

end if

end if

return

end idle

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By mitchellkza
      Hi folks
       
      Excuse this probably rather noob-ish question but I have been fiddling with OSX86 for years now and always left everything to the multitude of tools out there to get me up and running.
       
      Since recently moving to Clover UEFI booting I have done about 60+ installs on my hardware ranging from Mavericks, Yosemite, El-Capitan and now Sierra and in all cases I was always up and running and had no problems except for CPU Power Management.
       
      Only this morning I came across this post which goes step by step in detail about creating a unique serial number, board ID etc. 
       
      I have never done this on any of my installs, I just simply used Clover configurator, chose a system definition and never added any serial numbers as I had never even noticed the two buttons that say "shake"
       
      So I went through that guide and when I rebooted it asked me to relogin to icloud which I did and it accepted it.
       
      So what I want to know, is this even necessary due to the fact that everything Apple related has been working 100% without these serial numbers ie iCloud, iTunes, App Store, FindMyMac, iCloud KeyChain etc etc etc all been working just fine and dandy without all the serial numbers and board ID's.
       
      Thanks in advance for any reply or clarification.
       
      Regards
      Mitchell
       
       
    • By Si Vis Pacem
      Had this strange behavior of Sierra freezing and resetting if I connect any Arduino Uno Clone with an CH340/341 USB FTDI built in.
       
      The older driver I used - assigns a really long winded name with spaces to the USB port the Arduino IDE just cuts off and thus can't  find again for flashing - is the root of the problem. Just to clarify: Not the naming part - that's only a problem in the IDE.
       
      Björn's Techblog - Signed Mac OS Driver for Winchiphead CH340 serial bridge
    • By PKM
      Hi folks! I run El Capitan on VB by guide on this forum. Everything works great, but I'd like to do 2 more modifications and I'll be very thankful if you helped me...
       
      1. Adding serials to SMBIOS
      The main reason I run virtualisation of OSX is that I want to code apps with Xcode - Xcode wants you tu sign in with your Apple ID to sign apps. I've read that in virtualisation, there are no serials/information in SMBIOS, so "Apple" device can't be verified, which outcome is you to unable to login. I found something about Clover and Clover Configurator. I even tried that, but there were just many errors and problem wasn't solved. Can someone give me step-by-step instructions how to do this?
       
      2. Custom screen resolution 
      I think this'll be simpler than 1. but I couldn't find any exact guide. I managed to change resolution by VBoxManage setextradata "El Capitan" VBoxInternal2/EfiGopMode N, but I'd like to have 16:9 res (1920x1080). Is there any way to do it?
    • By ProPride
      I just completed a fresh reinstall of clover, and when I went into post installation I saw the hackintosh was a mac mini. I switched it to Mac Pro 3,1 for flexibility sake and went on with completing the imessage fix and all of the other things I needed to do to get myself back up and running. But, although my SMBios and About This Mac say it is an early 2008 Mac Pro, Finder displays a Mac Mini and iMessage refuses to allow me to send messages to anyone besides myself, even though my account is enabled. Any help?




    • By Joshie100
      A nice app I found that can be used to generate fake serial numbers in smbios required to get iCloud working.
       
       
       
      - App not made by me, their website is down so I am uploading it here.
×