Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

A Day in Code - Arduino

 
Marshal
Posts: 3145
466
Android Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just went to your Kickstarter page and I really liked to see that you have gone beyond the keyboard and screen and are incorporating Arduino in the lessons.  The example on the page was switch/LED project.  What other Arduino applications are you thinking of including in the book?
 
Author
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The book actually doesn't include Arduino-specific code or lessons. I wrote on the campaign page that the programming concepts and C syntax can be applied to programming the Arduino (such as for loops, while loops, if/else, functions, etc.).  Each code example in the book uses the C standard library stdio.h, and prints the output to the screen using the printf() function.  I chose to design the book this way so that the book and a free C compiler is all the reader needs to test out the code and play around with it to understand how the logic works.  The purpose of the book is to gain a good understanding of fundamental programming concepts and C syntax. I'm planning to have a resources page at the end of the book that  describes how C programming is used in embedded systems and mentions the Arduino as a resource.
 
Saloon Keeper
Posts: 22259
151
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One thing about the Arduino that makes it difficult is that I've never actually seen it officially said that the common Arduino programming language is in fact C++. Although years of cautiously exploring the boundaries have convinced me that most, if not all of the language features work on that platform.

What's definitely different is the runtime library environment. When compiling ".ino" files, the #include for "arduino.h" is implicit, and doesn't need to be explicitly stated in the sketch. And the standard C/C++ libraries may only be available as stripped-down versions, or missing.
 
Shari Eskenas
Author
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is in the Arduino FAQ:

"Can I program the Arduino board in C?"

"In fact, you already are; the Arduino language is merely a set of C/C++ functions that can be called from your code. Your sketch undergoes minor changes (e.g. automatic generation of function prototypes) and then is passed directly to a C/C++ compiler (avr-g++). All standard C and C++ constructs supported by avr-g++ should work in Arduino."
 
That's a very big dog. I think I want to go home now and hug this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic