Quintrix
Published © GPL3+

How To Make An Animated Robot

Simple project with animation eyes Oled dispaly and Arduino

BeginnerProtip1 hour213
How To Make An Animated Robot

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
gesture module
×1
shock sensor
×1
OLED Display 128x64 0.96 inch, I2C Interface
DIYables OLED Display 128x64 0.96 inch, I2C Interface
×1
LED, RGB
LED, RGB
optional component*
×1
SG90 Micro-servo motor
SG90 Micro-servo motor
×2
Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Story

Read more

Schematics

SCHEMATIC DIAGRAM

Code

code in INO

C/C++
//----------------------------------------------
//
//         Sketch Generated by Visuino
//               www.visuino.com
//           Version 8.0.0.79
//
//------------------ Source --------------------
//
// happy robot.visuino
//
 //----------------------------------------------

#define VISUINO_ARDUINO_NANO
#define _MITOV_DISPLAY_SSD1306_I2C

#include <OpenWire.h>
#include <Mitov.h>
#include <Wire.h>
#include <Mitov_Basic_I2C.h>
#include <Mitov_Display_SSD1306_I2C.h>
#include <Mitov_Graphics.h>
#include <Mitov_Graphics_Monochrome.h>
#include <Mitov_Counter.h>
#include <Mitov_BinaryGenerators.h>
#include <Mitov_Timing.h>
#include <Mitov_APDS9960.h>
#include <Mitov_SetValueItems.h>
#include <Mitov_Math.h>
#include <Mitov_LogicGates.h>
#include <Mitov_SineGenerator.h>
#ifndef VISUINO_ESP32
#include <Servo.h> // The Arduino Servo library https://github.com/arduino-libraries/Servo needs to be installed trough the Arduino IDE for this Scetch to compile!
#endif // VISUINO_ESP32
#include <Mitov_Servo.h>



// Shared Component Member Variables

namespace ComponentVariables
{
class
{
public:
  bool Value1 : 1;
  bool Value2 : 1;
  bool Value3 : 1;
  bool Value4 : 1;
  bool Value5 : 1;
  uint32_t Value6 : 6;
  bool Value7 : 1;
  bool Value8 : 1;
  bool Value9 : 1;
  uint32_t Value10 : 6;
  bool Value11 : 1;
  uint32_t Value12 : 6;
  bool Value13 : 1;
  uint32_t Value14 : 2;
  bool Value15 : 1;
  bool Value16 : 1;
  uint32_t Value17 : 32;
  uint32_t Value18 : 2;
  uint32_t Value19 : 2;
  uint32_t Value20 : 2;
  uint32_t Value21 : 2;
  bool Value22 : 1;
  uint32_t Value23 : 2;
  bool Value24 : 1;
  bool Value25 : 1;
  bool Value26 : 1;
  bool Value27 : 1;
  bool Value28 : 1;
  bool Value29 : 1;
  bool Value30 : 1;
  bool Value31 : 1;
  bool Value32 : 1;
  bool Value33 : 1;
  bool Value34 : 1;
  bool Value35 : 1;
  bool Value36 : 1;
  bool Value37 : 1;
  bool Value38 : 1;
  bool Value39 : 1;
  bool Value40 : 1;
  bool Value41 : 1;
  bool Value42 : 1;
  bool Value43 : 1;
  bool Value44 : 1;
  bool Value45 : 1;
  bool Value46 : 1;
  bool Value47 : 1;
  bool Value48 : 1;
  bool Value49 : 1;
  bool Value50 : 1;
  bool Value51 : 1;

} BitFields;

class Variable1
{
public:
  inline static bool GetValue() { return BitFields.Value1; }
  inline static void SetValue( bool AValue ) { BitFields.Value1 = AValue; }

};

class Variable2
{
public:
  inline static bool GetValue() { return BitFields.Value2; }
  inline static void SetValue( bool AValue ) { BitFields.Value2 = AValue; }

};

class Variable3
{
public:
  inline static bool GetValue() { return BitFields.Value3; }
  inline static void SetValue( bool AValue ) { BitFields.Value3 = AValue; }

};

class Variable4
{
public:
  inline static bool GetValue() { return BitFields.Value4; }
  inline static void SetValue( bool AValue ) { BitFields.Value4 = AValue; }

};

class Variable5
{
public:
  inline static bool GetValue() { return BitFields.Value5; }
  inline static void SetValue( bool AValue ) { BitFields.Value5 = AValue; }

};

class Variable6
{
public:
  inline static uint32_t GetValue() { return BitFields.Value6; }
  inline static void SetValue( uint32_t AValue ) { BitFields.Value6 = AValue; }

};

class Variable7
{
public:
  inline static bool GetValue() { return BitFields.Value7; }
  inline static void SetValue( bool AValue ) { BitFields.Value7 = AValue; }

};

class Variable8
{
public:
  inline static bool GetValue() { return BitFields.Value8; }
  inline static void SetValue( bool AValue ) { BitFields.Value8 = AValue; }

};

class Variable9
{
public:
  inline static bool GetValue() { return BitFields.Value9; }
  inline static void SetValue( bool AValue ) { BitFields.Value9 = AValue; }

};

class Variable10
{
public:
  inline static uint32_t GetValue() { return BitFields.Value10; }
  inline static void SetValue( uint32_t AValue ) { BitFields.Value10 = AValue; }

};

class Variable11
{
public:
  inline static bool GetValue() { return BitFields.Value11; }
  inline static void SetValue( bool AValue ) { BitFields.Value11 = AValue; }

};

class Variable12
{
public:
  inline static uint32_t GetValue() { return BitFields.Value12; }
  inline static void SetValue( uint32_t AValue ) { BitFields.Value12 = AValue; }

};

class Variable13
{
public:
  inline static bool GetValue() { return BitFields.Value13; }
  inline static void SetValue( bool AValue ) { BitFields.Value13 = AValue; }

};

class Variable14
{
public:
  inline static uint32_t GetValue() { return BitFields.Value14; }
  inline static void SetValue( uint32_t AValue ) { BitFields.Value14 = AValue; }

};

class Variable15
{
public:
  inline static bool GetValue() { return BitFields.Value15; }
  inline static void SetValue( bool AValue ) { BitFields.Value15 = AValue; }

};

class Variable16
{
public:
  inline static bool GetValue() { return BitFields.Value16; }
  inline static void SetValue( bool AValue ) { BitFields.Value16 = AValue; }

};

class Variable17
{
public:
  inline static uint32_t GetValue() { return BitFields.Value17; }
  inline static void SetValue( uint32_t AValue ) { BitFields.Value17 = AValue; }

};

class Variable18
{
public:
  inline static uint32_t GetValue() { return BitFields.Value18; }
  inline static void SetValue( uint32_t AValue ) { BitFields.Value18 = AValue; }

};

class Variable19
{
public:
  inline static uint32_t GetValue() { return BitFields.Value19; }
  inline static void SetValue( uint32_t AValue ) { BitFields.Value19 = AValue; }

};

class Variable20
{
public:
  inline static uint32_t GetValue() { return BitFields.Value20; }
  inline static void SetValue( uint32_t AValue ) { BitFields.Value20 = AValue; }

};

class Variable21
{
public:
  inline static uint32_t GetValue() { return BitFields.Value21; }
  inline static void SetValue( uint32_t AValue ) { BitFields.Value21 = AValue; }

};

class Variable22
{
public:
  inline static bool GetValue() { return BitFields.Value22; }
  inline static void SetValue( bool AValue ) { BitFields.Value22 = AValue; }

};

class Variable23
{
public:
  inline static uint32_t GetValue() { return BitFields.Value23; }
  inline static void SetValue( uint32_t AValue ) { BitFields.Value23 = AValue; }

};

class Variable24
{
public:
  inline static bool GetValue() { return BitFields.Value24; }
  inline static void SetValue( bool AValue ) { BitFields.Value24 = AValue; }

};

class Variable25
{
public:
  inline static bool GetValue() { return BitFields.Value25; }
  inline static void SetValue( bool AValue ) { BitFields.Value25 = AValue; }

};

class Variable26
{
public:
  inline static bool GetValue() { return BitFields.Value26; }
  inline static void SetValue( bool AValue ) { BitFields.Value26 = AValue; }

};

class Variable27
{
public:
  inline static bool GetValue() { return BitFields.Value27; }
  inline static void SetValue( bool AValue ) { BitFields.Value27 = AValue; }

};

class Variable28
{
public:
  inline static bool GetValue() { return BitFields.Value28; }
  inline static void SetValue( bool AValue ) { BitFields.Value28 = AValue; }

};

class Variable29
{
public:
  inline static bool GetValue() { return BitFields.Value29; }
  inline static void SetValue( bool AValue ) { BitFields.Value29 = AValue; }

};

class Variable30
{
public:
  inline static bool GetValue() { return BitFields.Value30; }
  inline static void SetValue( bool AValue ) { BitFields.Value30 = AValue; }

};

class Variable31
{
public:
  inline static bool GetValue() { return BitFields.Value31; }
  inline static void SetValue( bool AValue ) { BitFields.Value31 = AValue; }

};

class Variable32
{
public:
  inline static bool GetValue() { return BitFields.Value32; }
  inline static void SetValue( bool AValue ) { BitFields.Value32 = AValue; }

};

class Variable33
{
public:
  inline static bool GetValue() { return BitFields.Value33; }
  inline static void SetValue( bool AValue ) { BitFields.Value33 = AValue; }

};

class Variable34
{
public:
  inline static bool GetValue() { return BitFields.Value34; }
  inline static void SetValue( bool AValue ) { BitFields.Value34 = AValue; }

};

class Variable35
{
public:
  inline static bool GetValue() { return BitFields.Value35; }
  inline static void SetValue( bool AValue ) { BitFields.Value35 = AValue; }

};

class Variable36
{
public:
  inline static bool GetValue() { return BitFields.Value36; }
  inline static void SetValue( bool AValue ) { BitFields.Value36 = AValue; }

};

class Variable37
{
public:
  inline static bool GetValue() { return BitFields.Value37; }
  inline static void SetValue( bool AValue ) { BitFields.Value37 = AValue; }

};

class Variable38
{
public:
  inline static bool GetValue() { return BitFields.Value38; }
  inline static void SetValue( bool AValue ) { BitFields.Value38 = AValue; }

};

class Variable39
{
public:
  inline static bool GetValue() { return BitFields.Value39; }
  inline static void SetValue( bool AValue ) { BitFields.Value39 = AValue; }

};

class Variable40
{
public:
  inline static bool GetValue() { return BitFields.Value40; }
  inline static void SetValue( bool AValue ) { BitFields.Value40 = AValue; }

};

class Variable41
{
public:
  inline static bool GetValue() { return BitFields.Value41; }
  inline static void SetValue( bool AValue ) { BitFields.Value41 = AValue; }

};

class Variable42
{
public:
  inline static bool GetValue() { return BitFields.Value42; }
  inline static void SetValue( bool AValue ) { BitFields.Value42 = AValue; }

};

class Variable43
{
public:
  inline static bool GetValue() { return BitFields.Value43; }
  inline static void SetValue( bool AValue ) { BitFields.Value43 = AValue; }

};

class Variable44
{
public:
  inline static bool GetValue() { return BitFields.Value44; }
  inline static void SetValue( bool AValue ) { BitFields.Value44 = AValue; }

};

class Variable45
{
public:
  inline static bool GetValue() { return BitFields.Value45; }
  inline static void SetValue( bool AValue ) { BitFields.Value45 = AValue; }

};

class Variable46
{
public:
  inline static bool GetValue() { return BitFields.Value46; }
  inline static void SetValue( bool AValue ) { BitFields.Value46 = AValue; }

};

class Variable47
{
public:
  inline static bool GetValue() { return BitFields.Value47; }
  inline static void SetValue( bool AValue ) { BitFields.Value47 = AValue; }

};

class Variable48
{
public:
  inline static bool GetValue() { return BitFields.Value48; }
  inline static void SetValue( bool AValue ) { BitFields.Value48 = AValue; }

};

class Variable49
{
public:
  inline static bool GetValue() { return BitFields.Value49; }
  inline static void SetValue( bool AValue ) { BitFields.Value49 = AValue; }

};

class Variable50
{
public:
  inline static bool GetValue() { return BitFields.Value50; }
  inline static void SetValue( bool AValue ) { BitFields.Value50 = AValue; }

};

class Variable51
{
public:
  inline static bool GetValue() { return BitFields.Value51; }
  inline static void SetValue( bool AValue ) { BitFields.Value51 = AValue; }

};

class Shared_int32_t_0 : public ::ComponentVariables::Variable1
{
protected:
  static int32_t FValue;

public:
  inline static int32_t GetVariableValue( const int32_t AInitialValue )
  {
    if( ::ComponentVariables::Variable1::GetValue() )
      return FValue;

    return AInitialValue;
  }

  inline static void SetVariableValue( const int32_t AValue ) { FValue = AValue; ::ComponentVariables::Variable1::SetValue( true ); }
  inline static int32_t &GetReference() { return FValue; }

  inline Shared_int32_t_0() { ::ComponentVariables::Variable1::SetValue( false ); }

};

int32_t Shared_int32_t_0::FValue;

class Shared_bool_0 : public ::ComponentVariables::Variable2
{
protected:
  static bool FValue;

public:
  inline static bool GetVariableValue( const bool AInitialValue )
  {
    if( ::ComponentVariables::Variable2::GetValue() )
      return FValue;

    return AInitialValue;
  }

  inline static void SetVariableValue( const bool AValue ) { FValue = AValue; ::ComponentVariables::Variable2::SetValue( true ); }
  inline static bool &GetReference() { return FValue; }

  inline Shared_bool_0() { ::ComponentVariables::Variable2::SetValue( false ); }

};

bool Shared_bool_0::FValue;

class Shared_bool_1 : public ::ComponentVariables::Variable3
{
protected:
  static bool FValue;

public:
  inline static bool GetVariableValue( const bool AInitialValue )
  {
    if( ::ComponentVariables::Variable3::GetValue() )
      return FValue;

    return AInitialValue;
  }

  inline static void SetVariableValue( const bool AValue ) { FValue = AValue; ::ComponentVariables::Variable3::SetValue( true ); }
  inline static bool &GetReference() { return FValue; }

  inline Shared_bool_1() { ::ComponentVariables::Variable3::SetValue( false ); }

};

bool Shared_bool_1::FValue;

class Shared_bool_2 : public ::ComponentVariables::Variable4
{
protected:
  static bool FValue;

public:
  inline static bool GetVariableValue( const bool AInitialValue )
  {
    if( ::ComponentVariables::Variable4::GetValue() )
      return FValue;

    return AInitialValue;
  }

  inline static void SetVariableValue( const bool AValue ) { FValue = AValue; ::ComponentVariables::Variable4::SetValue( true ); }
  inline static bool &GetReference() { return FValue; }

  inline Shared_bool_2() { ::ComponentVariables::Variable4::SetValue( false ); }

};

bool Shared_bool_2::FValue;

} // ComponentVariables

// Arduino Constant Declarations

namespace VisuinoConstants
{
class FloatValue4
{
public:
    inline static constexpr float GetValue() { return 150; }
};

class FloatValue13
{
public:
    inline static constexpr float GetValue() { return 0.699999988079071; }
};

class FloatValue14
{
public:
    inline static constexpr float GetValue() { return 1; }
};

class FloatValue15
{
public:
    inline static constexpr float GetValue() { return 0.200000002980232; }
};

class FloatValue1
{
public:
    inline static constexpr float GetValue() { return 30; }
};

class FloatValue5
{
public:
    inline static constexpr float GetValue() { return 390; }
};

class FloatValue0
{
public:
    inline static constexpr float GetValue() { return 0.811999976634979; }
};

class FloatValue7
{
public:
    inline static constexpr float GetValue() { return 100; }
};

class FloatValue9
{
public:
    inline static constexpr float GetValue() { return 2.77999997138977; }
};

class FloatValue3
{
public:
    inline static constexpr float GetValue() { return 0; }
};

class FloatValue8
{
public:
    inline static constexpr float GetValue() { return 0.0599999986588955; }
};

class FloatValue11
{
public:
    inline static constexpr float GetValue() { return 0.5; }
};

class FloatValue2
{
public:
    inline static constexpr float GetValue() { return 330; }
};

class FloatValue10
{
public:
    inline static constexpr float GetValue() { return 0.300000011920929; }
};

class FloatValue12
{
public:
    inline static constexpr float GetValue() { return 20; }
};

class FloatValue16
{
public:
    inline static constexpr float GetValue() { return 2; }
};

class FloatValue6
{
public:
    inline static constexpr float GetValue() { return 50; }
};

} // VisuinoConstants

// Pin Call Declarations

namespace PinCalls
{
class PinCallerReceive0
{
public:
  void Notify( void *_Data );

};
class PinCallerReceive1
{
public:
  void Notify( void *_Data );

};
class PinCallerReceive2
{
public:
  void Notify( void *_Data );

};
class PinCallerReceive3
{
public:
  void Notify( void *_Data );

};
class PinCallerReceive4
{
public:
  void Notify( void *_Data );

};
class PinCallerReceive5
{
public:
  void Notify( void *_Data );

};
class PinCallerReceive6
{
public:
  void Notify( void *_Data );

};
class PinCallerReceive7
{
public:
  void Notify( void *_Data );

};
class PinCallerReceive8
{
public:
  void Notify( void *_Data );

};
class PinCallerReceive9
{
public:
  void Notify( void *_Data );

};
class PinCallerReceive10
{
public:
  void Notify( void *_Data );

};
class PinCallerReceive11
{
public:
  void Notify( void *_Data );

};
class PinCallerReceive12
{
public:
  void Notify( void *_Data );

};
class PinCallerReceive13
{
public:
  void Notify( void *_Data );

};
class PinCallerReceive14
{
public:
  void Notify( void *_Data );

};
class PinCallerReceive15
{
public:
  void Notify( void *_Data );

};
class PinCallerReceive16
{
public:
  void Notify( void *_Data );

};
class PinCallerReceive17
{
public:
  void Notify( void *_Data );

};
class PinCallerReceive18
{
public:
  void Notify( void *_Data );

};
class PinCallerReceive19
{
public:
  void Notify( void *_Data );

};
class PinCallerReceive20
{
public:
  void Notify( void *_Data );

};
class PinCallerReceive21
{
public:
  void Notify( void *_Data );

};
class PinCallerReceive22
{
public:
  void Notify( void *_Data );

};
class PinCallerReceive23
{
public:
  void Notify( void *_Data );

};
class PinCallerReceive24
{
public:
  void Notify( void *_Data );

};
class PinCallerReceive25
{
public:
  void Notify( void *_Data );

};
class PinCallerReceive26
{
public:
  void Notify( void *_Data );

};
class PinCallerReceive27
{
public:
  void Notify( void *_Data );

};
} // PinCalls

// Call Chains

namespace CallChains
{
class Render1
{
public:
  inline static uint32_t Count() { return 0; }
  static void Call();

};
class TryActive1
{
public:
  inline static uint32_t Count() { return 0; }
  static void Call( bool & AResult );

};
class TryActive2
{
public:
  inline static uint32_t Count() { return 0; }
  static void Call( bool & AResult );

};
class TryActive3
{
public:
  inline static uint32_t Count() { return 0; }
  static void Call( bool & AResult );

};
class TryActive4
{
public:
  inline static uint32_t Count() { return 2; }
  static void Call( bool & AResult );

};
} // CallChains

// System Objects Declarations

namespace BoardDeclarations
{
Mitov::TElapsedMicros ElapsedSystemMicros;
} // BoardDeclarations

// Arduino Board Declarations

namespace BoardDeclarations
{
namespace Types
{
typedef Mitov::ArduinoDigitalOutputChannel<
  Mitov::ConstantProperty<22, bool, false>, // IsAnalog
  Mitov::ConstantProperty<24, bool, false>, // IsCombinedInOut
  Mitov::ConstantProperty<21, bool, false>, // IsOpenDrain
  Mitov::ConstantProperty<26, bool, false>, // IsOutput
  Mitov::ConstantProperty<20, bool, false>, // IsPullDown
  Mitov::ConstantProperty<5, bool, false >, // IsPullUp
  Mitov::ConstantProperty<23, bool, false>, // IsRawInput
  Mitov::DigitalPin_EmbeddedPinImplementation<6, ::PinCalls::PinCallerReceive0 >, // OutputPin
  2 // PIN
  > ArduinoDigitalChannel_2;
} // Types

namespace Instances
{
Types::ArduinoDigitalChannel_2 ArduinoDigitalChannel_2;
} // Instances

namespace Types
{
typedef Mitov::ArduinoDigitalChannel<
  Mitov::ConstantProperty<51, bool, false>, // InitialValue
  Mitov::ConstantProperty<22, bool, false>, // IsAnalog
  Mitov::ConstantProperty<24, bool, false>, // IsCombinedInOut
  Mitov::ConstantProperty<21, bool, false>, // IsOpenDrain
  Mitov::ConstantProperty<25, bool, true>, // IsOutput
  Mitov::ConstantProperty<20, bool, false>, // IsPullDown
  Mitov::ConstantProperty<5, bool, false >, // IsPullUp
  Mitov::ConstantProperty<23, bool, true>, // IsRawInput
  Mitov::DigitalPin_NoImplementation<6 >, // OutputPin
  13 // PIN
  > ArduinoDigitalChannel_13;
} // Types

namespace Instances
{
Types::ArduinoDigitalChannel_13 ArduinoDigitalChannel_13;
} // Instances

} // BoardDeclarations

// Declarations

namespace Declarations
{
namespace Types
{
typedef Mitov::DisplaySSD1306<
  Mitov::Display_odtSSD_I2C<
      TwoWire, // 0_I2C_TYPE_PIN
      Wire, // 1_I2C_NAME_PIN
      Mitov::ConstantProperty<28, uint8_t, 60 > // Address
       >, // 0_IMPLEMENTATION
  Mitov::DisplaySSD1306Buffered<
      64, // Height
      128 // Width
       >, // 0_IMPLEMENTATION_BUFFER
  Mitov::DisplayOrientationUp, // 0_IMPLEMENTATION_ORIENTATION
  Mitov::ConstantProperty<16, Mitov::TArduinoMonochromeColor, Mitov::tmcBlack >, // BackgroundColor
  Mitov::ConstantPropertyFloat<11, float, ::VisuinoConstants::FloatValue0 >, // Contrast
  Mitov::EmbeddedCallChain<CallChains::Render1 >, // Elements_Render
  Mitov::ConstantProperty<29, uint32_t, 0 >, // FCursorX
  Mitov::ConstantProperty<31, uint32_t, 0 >, // FCursorY
  Mitov::ConstantProperty<8, Mitov::TArduinoGraphicsOrientation, Mitov::goUp >, // Orientation
...

This file has been truncated, please download it to see its full contents.

Credits

Quintrix
6 projects • 3 followers
Contact

Comments

Please log in or sign up to comment.