QL Arduino

Anything QL Software or Programming Related.
Post Reply
Derek_Stewart
Font of All Knowledge
Posts: 3956
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

QL Arduino

Post by Derek_Stewart »

Hi,

I have a Arduino UNO attached to a PC, which I use Norman's excellent book to programme the Arduino ia the USB connection.

The book details programming the Arduino by C/C++ programming with a pre-written libraries. Could an Arduino be programmed from QPC2 using C68. This would mean that a Arduino Library would have to be written.

There is an older Arduino S3v3 R2, based on an 8 Bit Atmel 2486 or ATmega8, OK this have less meory available, but has a standard serial port, which can be connected to a QL, Q68. Is this worth pursuing?

The PCBs are open source and should npot cost too much to make, if there is any interest.


Regards,

Derek
User avatar
NormanDunbar
Forum Moderator
Posts: 2271
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: QL Arduino

Post by NormanDunbar »

Hi Derek,

A lot of the Arduino language is C++ based, so unless someone msnages to convert it to C68, in C mode, I would think it unlikely.

The Serial interface, for example, the features to "print" and "println" descend from the "printable" base class, and the various "read" functions descend from the "stream" base class, which printable also descends from. Multiple inheritance.

Even worse, in C++, the ability to declare many class functions with the same name, has been used to allow different data types to be "print"ed.

Code: Select all

byte byt = 'A';
int intt = 12345;
long lng = 1234567890L;

Serial.println(byt);
Serial.println(intt);
Serial.println(lng);
Same "println" function name, different data types as parameters. In C (or C68) those would all be differently named.

I am however, very glad to hear that you have found my bookto be useful. Thank you very much.


Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
Derek_Stewart
Font of All Knowledge
Posts: 3956
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: QL Arduino

Post by Derek_Stewart »

Hi Norm,

I am a little confused on how to programme the Arduino with C, when all the books that go beyond the Arduino IDE, use C++

I do not know how to use C++, well maybe I need to readvanothet book.

But can not do C++ on the QL.


Regards,

Derek
User avatar
NormanDunbar
Forum Moderator
Posts: 2271
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: QL Arduino

Post by NormanDunbar »

Hi Derek,

You are already using C++ -- every time you use Serial.print, or the Wire or EEPROM libraries etc.

It's not difficult, most of the time.


Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
Derek_Stewart
Font of All Knowledge
Posts: 3956
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: QL Arduino

Post by Derek_Stewart »

Hi Norm,

I have not read a C++ Book yet, so do not anything anout cout....

Coukd C68 be madd to have classes?


Regards,

Derek
User avatar
Peter
QL Wafer Drive
Posts: 1987
Joined: Sat Jan 22, 2011 8:47 am

Re: QL Arduino

Post by Peter »

Derek_Stewart wrote:Coukd C68 be madd to have classes?
No, it's not a C++ compiler. Even for QDOS-GCC, which ist closer to that, the effort for C++ support was seen as quite prohibitive.


Post Reply