Arduino and iOS: example code?
Hey Chris,
I'm looking to connect an ipad running MWorks iOS to a reward pump, via an arduino board. Can you point me towards example code that might do something like this? To clarify, the USB or BLE io-device must be connected to the server (the ipad), not the machine running the client.
Let me know, and thanks!
Rishi
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Christopher Sta... on 25 Mar, 2019 02:59 PM
Hi Rishi,
I've attached a short example experiment that demonstrates how to set this up on the MWorks side. It configures pin 13 on the Arduino (which is usually connected to a built-in LED) as a digital output line. Once the experiment is running, setting the variable
pump_control_line
to true or 1 should turn the LED on, and setting it false/0 should turn it off.On the Arduino side, you need to install the correct firmware. If you want to bring your board to my office, I can do this for you very easily. If you'd prefer to do it yourself, then
$HOME/Documents/Arduino/libraries
.If you're using a Feather M0, in the window that opens, navigate to the tab containing the file
bleConfig.h
, and change the lineto
(In other words, uncomment that line.)
Select your board and port, and build and upload the example as per usual.
Again, I can do this for you, if you prefer.
Correct. FYI, USB is an option only on a Mac. BLE works with both Macs and iPads.
Chris
Christopher Stawarz closed this discussion on 02 Apr, 2019 07:26 PM.
Christopher Stawarz re-opened this discussion on 26 Apr, 2019 03:22 PM
Support Staff 2 Posted by Christopher Sta... on 26 Apr, 2019 03:26 PM
Hi Rishi & Michael,
FYI, I've written a more detailed guide on how to set up a Feather M0 Bluefruit LE. If you have any problems, please let me know.
Chris
Christopher Stawarz closed this discussion on 02 May, 2019 05:43 PM.