Skip to content

GSTCH/SketchMadeEASY

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sketch made EASY for Arduino

This libary is an abstraction of an Arduino sketch on logic level. Instead of programming in bits and bytes, the control logic is configured by combining the classes. For this create objects of inputs, actions and combine them with relations and conditions. There are an amount of example to see how easy this library is to use.
The library supports the remote control FlySky FS-i6X (up to 10 channels). The same functions are also available by an App (connected with bluetooth). The App has been developed with "MIT AppInventor".

Introduction Video

Click on the image to play the video

Getting started

Sketches are no longer programmed with this library, but can be configured by combining different classes. How does it work? Basic idea is how an Arduino works: It combines inputs with actuators through logic. A sketch with Sketch made EASY is created in three steps:

  1. Definition of the inputs
  2. Definition of the actuators (outputs)
  3. Definition of logic:
    • Define at which value of an input something should happen (condition)
    • Create a relation if the condition is true and specify the value of the actuator

There are many examples. The example directories contains a schema as well. Here the code of a toggling LED (the most common hello world example with Arduino). Open "File:/Examples/SketchMadeEasy/Examples/04-ToggleingLed" into Arduino IDE to see full code.
  //((*** Initialize: Configure your sketch here....

  //** Create input:
  // Input changes value periodically and toggles between High and Low.
  Input* timer = new Timer(TIMER_INTERVAL_MSEC, true);

  //** Create actuator. 
  // A DigitalOutput knows the value On and Off.
  Actuator* led = new DigitalOutput(LED_PIN);

  //** Define logic with conditions and relations
  // Define relation when timer value changes to High
  Condition* conditionLedOn = new CompareCondition(timer, OpEQ, Timer::High);
  Relation* relationLedOn = new Relation1to1(conditionLedOn, led, FixValue::On());

  // Define relation when timer value changes to Low
  Condition* conditionLedOff = new CompareCondition(timer, OpEQ, Timer::Low);
  Relation* relationLedOff = new Relation1to1(conditionLedOff, led, FixValue::Off());
  // ***))

Supported hardware (Classes)

Inputs Actuators Logic
Calculate ActuatorCollection Conditions
ConditionInput Buzzer CompareCondition
DependentInput DigitalOutput ElseCondition
DigitalInput EncodeModeI2C LogicCondition
FixValue EncoderMotorL298
Inverter EncoderMotorL9110 Relations
IteratorValue MotorI2C CrawlerSteering
JoystickAxis MotorL298 Relation1to1
LoopSwitch MotorL9110
MonoFlop MotorServo360I2C RemoteControls
Switch2Position MotorServo360Pwm AppInventor
Switch3Position MotorServo360T1 FlySky
Timer MotorServo360T2
ToggleSwitch MotorStepperRotate
UltrasonicRangefinder MotorStepperRotateI2C
VariableInput ServoI2C
ServoPwm
ServoStepperPosition
ServoStepperPositionI2C
ServoT1
ServoT2
VariableOutput

Workboard

Sketch made EASY contains not only software. A construction kit of different modules makes it possible to put together an individual workboard. With the STL files, these can be produced using a 3D printer.
Workboard with Arduino Uno and Breadboard My test board

Documentation

See Wiki of this Repository