ATS for Arduino

FYI.

I managed to set up an API for Arduino programming:

This is just the beginning, and more will be added once I get my Arduino
Uno.

Right now, I am using Arduino.mk to do compilation:

There are some simple examples showing how this can be done:

As Arduino uses C++, I rely on dot-notation overloading in ATS to mimic
method calls.
So far the syntax should be quite pleasant to use.

Cheers!

BTW, I am loosely following Julien Bayle’s book on

C programming for Arduino

for now.On Saturday, November 8, 2014 2:19:26 PM UTC-5, gmhwxi wrote:

FYI.

I managed to set up an API for Arduino programming:

https://github.com/githwxi/ATS-Postiats-contrib/tree/master/contrib/arduino

This is just the beginning, and more will be added once I get my Arduino
Uno.

Right now, I am using Arduino.mk to do compilation:

GitHub - sudar/Arduino-Makefile: Makefile for Arduino sketches. It defines the workflows for compiling code, flashing it to Arduino and even communicating through Serial.

There are some simple examples showing how this can be done:

https://github.com/githwxi/ATS-Postiats-contrib/tree/master/contrib/arduino

As Arduino uses C++, I rely on dot-notation overloading in ATS to mimic
method calls.
So far the syntax should be quite pleasant to use.

Cheers!

Hi,

I have just got my Aduino Uno board.

I modified some files to get both Blink and BlinkTalk to work.

If you want to try, here are the 3 steps:

STEP1:

First git-clone the following link:

git clone GitHub - githwxi/ATS-Postiats-contrib: ATS-Postiats-contrib is primarily for packages contributed to ATS-Postiats

STEP2: Then execute the following two command-lines:

cd ATS-Postiats-contrib/contrib/arduino/
git clone GitHub - sudar/Arduino-Makefile: Makefile for Arduino sketches. It defines the workflows for compiling code, flashing it to Arduino and even communicating through Serial.

STEP3: Say you want to try the Blink example. Please do

cd TEST/Blink
make -f Makefile_ats
make upload

That’s it!

I hereby assume that you have the latest ATS2-0.1.5 installed
and also your Arduino Uno board is properly plugged in. For other
types of Arduino boards, you need to modify the Makefile a bit.

Cheers!On Saturday, November 8, 2014 2:19:26 PM UTC-5, gmhwxi wrote:

FYI.

I managed to set up an API for Arduino programming:

https://github.com/githwxi/ATS-Postiats-contrib/tree/master/contrib/arduino

This is just the beginning, and more will be added once I get my Arduino
Uno.

Right now, I am using Arduino.mk to do compilation:

GitHub - sudar/Arduino-Makefile: Makefile for Arduino sketches. It defines the workflows for compiling code, flashing it to Arduino and even communicating through Serial.

There are some simple examples showing how this can be done:

https://github.com/githwxi/ATS-Postiats-contrib/tree/master/contrib/arduino

As Arduino uses C++, I rely on dot-notation overloading in ATS to mimic
method calls.
So far the syntax should be quite pleasant to use.

Cheers!

I will try to implement merge-sort on Arduino next time :slight_smile:

It is done:

Here is some output from a test run:

0, 1, 2, 3, 4, 5, 6, 7, 8, 9 // sorted
6, 7, 0, 3, 4, 1, 5, 9, 8, 2 // randomized
0, 1, 2, 3, 4, 5, 6, 7, 8, 9 // sorted
6, 7, 1, 8, 5, 0, 3, 4, 2, 9 // randomized
… …On Tuesday, November 11, 2014 3:03:54 PM UTC-5, gmhwxi wrote:

Today I wrote a program that rotates a list (not array) of number.

For instance, say we start with 0, 1, 2, 3, 4; then we should see

0, 1, 2, 3, 4
1, 2, 3, 4, 0
2, 3, 4, 0, 1
3, 4, 0, 1, 2
4, 0, 1, 2, 3
0, 1, 2, 3, 4
… …

My code is here:

https://github.com/githwxi/ATS-Postiats-contrib/blob/master/contrib/arduino/TEST/ListOps/ListOps.dats

I find this to be a pretty cool example because it makes genuine use of
linear datatypes (plus pattern matching).

I will try to implement merge-sort on Arduino next time :slight_smile:

Cheers!

On Saturday, November 8, 2014 2:19:26 PM UTC-5, gmhwxi wrote:

FYI.

I managed to set up an API for Arduino programming:

https://github.com/githwxi/ATS-Postiats-contrib/tree/master/contrib/arduino

This is just the beginning, and more will be added once I get my Arduino
Uno.

Right now, I am using Arduino.mk to do compilation:

GitHub - sudar/Arduino-Makefile: Makefile for Arduino sketches. It defines the workflows for compiling code, flashing it to Arduino and even communicating through Serial.

There are some simple examples showing how this can be done:

https://github.com/githwxi/ATS-Postiats-contrib/tree/master/contrib/arduino

As Arduino uses C++, I rely on dot-notation overloading in ATS to mimic
method calls.
So far the syntax should be quite pleasant to use.

Cheers!

Today I wrote a program that rotates a list (not array) of number.

For instance, say we start with 0, 1, 2, 3, 4; then we should see

0, 1, 2, 3, 4
1, 2, 3, 4, 0
2, 3, 4, 0, 1
3, 4, 0, 1, 2
4, 0, 1, 2, 3
0, 1, 2, 3, 4
… …

My code is here:

I find this to be a pretty cool example because it makes genuine use of
linear datatypes (plus pattern matching).

I will try to implement merge-sort on Arduino next time :slight_smile:

Cheers!On Saturday, November 8, 2014 2:19:26 PM UTC-5, gmhwxi wrote:

FYI.

I managed to set up an API for Arduino programming:

https://github.com/githwxi/ATS-Postiats-contrib/tree/master/contrib/arduino

This is just the beginning, and more will be added once I get my Arduino
Uno.

Right now, I am using Arduino.mk to do compilation:

GitHub - sudar/Arduino-Makefile: Makefile for Arduino sketches. It defines the workflows for compiling code, flashing it to Arduino and even communicating through Serial.

There are some simple examples showing how this can be done:

https://github.com/githwxi/ATS-Postiats-contrib/tree/master/contrib/arduino

As Arduino uses C++, I rely on dot-notation overloading in ATS to mimic
method calls.
So far the syntax should be quite pleasant to use.

Cheers!

Here is a README for testing the Arduino code:

https://github.com/githwxi/ATS-Postiats-contrib/blob/master/contrib/arduino/TEST/READMEOn Monday, November 10, 2014 4:34:56 PM UTC-5, gmhwxi wrote:

Hi,

I have just got my Aduino Uno board.

I modified some files to get both Blink and BlinkTalk to work.

If you want to try, here are the 3 steps:

STEP1:

First git-clone the following link:

git clone GitHub - githwxi/ATS-Postiats-contrib: ATS-Postiats-contrib is primarily for packages contributed to ATS-Postiats

STEP2: Then execute the following two command-lines:

cd ATS-Postiats-contrib/contrib/arduino/
git clone GitHub - sudar/Arduino-Makefile: Makefile for Arduino sketches. It defines the workflows for compiling code, flashing it to Arduino and even communicating through Serial.

STEP3: Say you want to try the Blink example. Please do

cd TEST/Blink
make -f Makefile_ats
make upload

That’s it!

I hereby assume that you have the latest ATS2-0.1.5 installed
and also your Arduino Uno board is properly plugged in. For other
types of Arduino boards, you need to modify the Makefile a bit.

Cheers!

On Saturday, November 8, 2014 2:19:26 PM UTC-5, gmhwxi wrote:

FYI.

I managed to set up an API for Arduino programming:

https://github.com/githwxi/ATS-Postiats-contrib/tree/master/contrib/arduino

This is just the beginning, and more will be added once I get my Arduino
Uno.

Right now, I am using Arduino.mk to do compilation:

GitHub - sudar/Arduino-Makefile: Makefile for Arduino sketches. It defines the workflows for compiling code, flashing it to Arduino and even communicating through Serial.

There are some simple examples showing how this can be done:

https://github.com/githwxi/ATS-Postiats-contrib/tree/master/contrib/arduino

As Arduino uses C++, I rely on dot-notation overloading in ATS to mimic
method calls.
So far the syntax should be quite pleasant to use.

Cheers!

g++ is a lot more strict in terms of typechecking.

For casting, static_cast seems to be the way to go.

Also, in order to use the existing CATS-files in ATSLIB/prelude,
I use the flag -fpermissive (plus the flag -w for suppressing warning
messages).On Monday, November 10, 2014 6:16:18 AM UTC-5, Kiwamu Okabe wrote:

Hi all,

On Sun, Nov 9, 2014 at 4:19 AM, gmhwxi <gmh...@gmail.com <javascript:>> wrote:

I managed to set up an API for Arduino programming:

https://github.com/githwxi/ATS-Postiats-contrib/tree/master/contrib/arduino

This is just the beginning, and more will be added once I get my Arduino
Uno.

Sounds good.
I should follow it running on my board, and would like to write some
network applications running on Arduino Uno.

As Arduino uses C++, I rely on dot-notation overloading in ATS to mimic
method calls.
So far the syntax should be quite pleasant to use.

So great! You deleted one of my headaches.
Today’s embedded archititure many time depends on C++ API.

Arduino - Home
mbed | Mbed

The headache is I should re-write the C++ library as the ATS language
to use it for ATS application.
This technique using dot-notaion to access C++ API is very useful for
any application domains,
that includes application on POSIX API.

Thank’s,

Kiwamu Okabe at METASEPI DESIGN