Pigeon-Kicker
Published © GPL3+

C++ Custom Code Injection for balancing Visuino robot

With 80% less memory usage that previous versions and a new Custom Code Injection component, Visuino is a Robotics reality for all of us us.

IntermediateWork in progress6 minutes1,273
C++ Custom Code Injection for balancing Visuino robot

Things used in this project

Story

Read more

Schematics

basically has nothing used to connect to Arduino

Visuino build file

Opens with visuino

Code

Visuino outputted code...

C/C++
May change with future Visuino Updates
//----------------------------------------------
//
//        Sketch Generated by Visuino
//              www.visuino.com
//          Version  7.8.2.228
//
//------------------ Source --------------------
//
// MEGA_BREAD_CODE_INJECTION.owarduino
//
//----------------------------------------------

#define VISUINO_ARDUINO_UNO

#include <OpenWire.h>
#include <Mitov.h>
#include <Mitov_FormattedSerial.h>

// Custom Code Declarations

namespace CustomCode
{
  class TCustomCode1
  {
  public:
    void SystemInit();

  public:
    void SystemLoopBegin( unsigned long currentMicros );

  };
} // CustomCode

// Declarations

namespace Declarations
{
CustomCode::TCustomCode1 CustomCode1;
} // Declarations

// Custom Code Implementations

namespace CustomCode
{
void TCustomCode1::SystemInit()
{
pinMode(LED_BUILTIN, OUTPUT);
}

void TCustomCode1::SystemLoopBegin( unsigned long currentMicros )
{
digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                       // wait for a second
}

} // CustomCode

namespace ComponentsHardware
{
void SystemUpdateHardware()
{
}
} // ComponentsHardware

//The setup function is called once at startup of the sketch
void setup()
{
  Declarations::CustomCode1.SystemInit();
}

// The loop function is called in an endless loop
void loop()
{
  unsigned long A_Current_Microseconds = micros();

  Declarations::CustomCode1.SystemLoopBegin( A_Current_Microseconds );
}

Credits

Pigeon-Kicker

Pigeon-Kicker

19 projects • 31 followers
Computer guru from the 80's, currently disabled veteran. Building this stuffs for my son to learn robotics.

Comments