FreeBasic and Arduino communication

For issues with communication ports, protocols, etc.
caseih
Posts: 2157
Joined: Feb 26, 2007 5:32

Re: FreeBasic and Arduino communication

Post by caseih »

The Arduino IDE and build environment is not very smart. And I always configure the IDE to never edit any files as I prefer to use my own editor (vim). I would really love to be able to set up a Makefile that would compile against the Arduino libraries. Would be a lot faster as object files would only recompile when necessary. I looked into this once. I'll have to revisit it.

I really like the Arduino abstractions. I like the simple setup() and loop() thing, and I like the pin abstractions. Real AVR C involves selecting ports and pins. I prefer the Arduino way where the pins can be accessed by number (the mapping is set in the hardware definition files, which is different between different types of boards). Provided you know how the ports are wired, you can basically use Arduino's programming language and libraries on any Atmel chip, and some Arm chips. I have a little board called the Teensy and it has a different bootloader than Arduinos do, but there is a plugin for the Arduino IDE which is convenient. I've also programmed AtTiny's before using the Arduino IDE. Requires an AVR programmer though as the Attiny has no boot loader.

By the way, BasicCoder, my little Arduino LCD screen project ended in a sort of failure. I couldn't get my code to run fast enough to keep up with the commands coming in over serial. I kept missing bytes and overflowing the little uart buffer. It should work, though. I just need to optimize the routines, but that will have to wait until the GPS unit is not being used.
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: FreeBasic and Arduino communication

Post by BasicCoder2 »

caseih wrote:Real AVR C involves selecting ports and pins. I prefer the Arduino way where the pins can be accessed by number (the mapping is set in the hardware definition files, which is different between different types of boards).
However you can apparently still program at a "lower" level if you like.
https://balau82.wordpress.com/2011/03/2 ... in-pure-c/
The LED blinking example compiled using the Arduino IDE and ran ok when uploaded to an Arduino board.
By the way, BasicCoder, my little Arduino LCD screen project ended in a sort of failure.
Could you not simply make the serial connection cord longer?

Code: Select all

' +---------+                        +----------+
' | display |   serial connection    |   GPS    |
' |         |<---------------------->|          |
' | buttons |        cord            | RECORDER |
' +---------+                        +----------+
At the moment my interest in programming and hardware are in the doldrums as I am unable to find any motivation for any FB or hardware project.
.
caseih
Posts: 2157
Joined: Feb 26, 2007 5:32

Re: FreeBasic and Arduino communication

Post by caseih »

Yes, Arduino is really just normal C++ with a nice abstraction library. You can still access things the normal way if you want to. Though you do have to work with setup() and loop(). Arduino takes care of main.

I thought about just running a cord and mounting the little screen and buttons where I wanted it. But in the end I decided to keep it all in one unit so I could move it to other vehicles easily (self-contained). I figure I can mount the whole unit in a convenient enough spot. Decoding the serial protocol was a fun project though.
Post Reply