element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Blog Arduino to C/C++ for LED Cube
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: dzuz
  • Date Created: 17 Apr 2019 3:17 PM Date Created
  • Views 2057 views
  • Likes 0 likes
  • Comments 8 comments
  • led_cube
  • led cube
  • c++ coding
  • 4x4_led_cube
Related
Recommended

Arduino to C/C++ for LED Cube

dzuz
dzuz
17 Apr 2019

Does anyone know how to convert arduino code to c/c++?

 

I have made a 4x4x4 LED cube, but I need to have the code in c/c++, not just arduino code.

 

If anyone knows of a converter or can link a site to easily learn c/c++ on an arduino, that would be greatly appreciated. Thanks!

 

-Dan

  • Sign in to reply

Top Comments

  • ralphjy
    ralphjy over 6 years ago +2
    You don't indicate why you can't use the Arduino language and IDE. Maybe this is a class assignment? Anyway, you'll need to set up an avr-gcc toolchain and will need to replicate all the stuff that the…
  • jomoenginer
    jomoenginer over 6 years ago in reply to jomoenginer +2
    One other thing, a good book you might want to consider is AVR Programming by Elliot Williams. https://www.amazon.com/AVR-Programming-Learning-Software-Technology/dp/1449355781
  • jomoenginer
    jomoenginer over 6 years ago +1
    Are you using the Arduino IDE? If so, Arduino is C and/or C++. Just when you use the Arduino IDE, you need a setup and loop function instead of a main. You could just add your code as interfaces with classes…
  • beacon_dave
    beacon_dave over 6 years ago in reply to jomoenginer

    Elliot Williams also did a webcast with publisher O'Reilly which may be of interest. It's available to watch on YouTube:

     

    Programming AVR Microcontrollers in C - O'Reilly Webcast 

    https://www.youtube.com/watch?v=ERY7d7W-6nA

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • beacon_dave
    beacon_dave over 6 years ago in reply to jomoenginer

    Warwick Smith's 'C Programming with Arduino' is another good introduction for those wanting to move away from the Arduino IDE but whilst retaining the familiarity of the Uno/MEGA hardware.

    https://www.elektor.com/c-programming-with-arduino

     

    This low cost ATMEGA328P dev board is also very handy to use with the above book as it gives an Arduino Uno footprint without the need for a separate ICSP programmer/debugger.

    ATMEGA328P-XMINI ATMEGA328P-XMINI

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • jomoenginer
    jomoenginer over 6 years ago in reply to jomoenginer

    One other thing, a good book you might want to consider is AVR Programming by Elliot Williams.

    https://www.amazon.com/AVR-Programming-Learning-Software-Technology/dp/1449355781

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • jomoenginer
    jomoenginer over 6 years ago in reply to dzuz

    Try adding "avr" before iom328.h.

    Such as :

       #include <avr/iom328p.h>

    Or just

    "iom328p.h"

     

     

    However, you might want to look at an example such as:

    https://github.com/ElektorLabs/Arduino/blob/master/source2/avr/cores/arduino/avr/iom328p.h

     

    But, as Ralph mentioned, you need to ensure you have your tool chain set correctly.

     

    Also, when posting code, it is best to use the ">>" option at the top of the edit window and select the code format you wish to post your code in.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • ralphjy
    ralphjy over 6 years ago

    You don't indicate why you can't use the Arduino language and IDE.  Maybe this is a class assignment?  Anyway, you'll need to set up an avr-gcc toolchain and will need to replicate all the stuff that the Arduino code is doing for you.  Here is a link that may help you: https://www.instructables.com/id/AVR-Programming-with-Arduino-AVRdude-and-AVR-gcc/

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube