Hi, Is there any way to use Arduino with Android
# androidthings
u
Hi, Is there any way to use Arduino with Android
d
Not by running Android on Arduino :)
k
I wrote a medium post time ago, but it is super outdated
that was using a ble module with an arduino nano. but there are boards nowadays that have the ble integrated, easier to program
that second one is using an arduino based board with ble, then comunicating with android I would take a more modern approach and use coroutines
u
Thanks for the information I actually have ble module and Arduino UNO r3 What I was thinking to code that by Android but that is not possible since Arduino ide is based on C language But the good thing is that I can write program in C I mean that is the first programming language I learnt
I appreciate your medium post and sharing your knowledge here
k
No worries
What are you trying to do exactly, if you don’t mind me asking? Adafruit has some boards and APIs that make things very easy using python. It would be super cool if you could program the arduino directly in kotlin, but I don’t anyone has written any IDE extension or plugin for it yet.
u
I know about that Adafruit new boards but those will likely same in half price of raspberry pi and I don't have funds for this, I actually purchased L293D motor controller and Arduino Uno and some 300mA 12V motors that I want to control from Android and my main stream is mobile application development so I am just curious about how can I write programs in Kotlin to run on Arduino or any cheap and compatible hardware since I have some other projects also and I am not ready to buy such pricey chips for these small projects, don't mind but this time I really not in a state to buy some more chips for this task I know I sound weird but this is it
k
I understand. So probably what you want to know first is the capabilities of your ble module. I don’t know what module it is, but maybe you cannot easily modify the gatt service or characteristics and have to stick to the default one, but that is not too bad. If what you need to do is just enable and disable those motors, just create a simple protocol, along the lines of 0x00 enables motor one, 0x01 disables it, 0x02 enables motor 2, so on and so for. Presumably you have that ble module connected to the by spi, so it shouldn’t be too difficult reading and then switching on and off those motors. Happy to help