Skip to content

Commit

Permalink
Files added
Browse files Browse the repository at this point in the history
  • Loading branch information
jasys-de committed Aug 9, 2017
1 parent 8c7ac15 commit 94fa19a
Show file tree
Hide file tree
Showing 8 changed files with 541 additions and 0 deletions.
Binary file added 1708070102_ArduinoInstallBARTH.pdf
Binary file not shown.
Binary file added Boards/BARTH-2017.8.4.tar.bz2
Binary file not shown.
101 changes: 101 additions & 0 deletions Examples/STG800.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
/*
STG-800 sample code
For more informations, see https://www.barth-elektronik.com for more informations
This example code is open source.
created 7. Aug 2017
*/

#include <EEPROM.h>

int inPin = 6; // first digital pin
int Val = 0;
int Channel = 0;

// the setup function runs once when you press reset or power the board
void setup() {

pinMode(LED_BUILTIN, OUTPUT); // initialize digital pin LED_BUILTIN as an output.

pinMode(0, OUTPUT); // initialize High and Low side digital outputs as an output.
pinMode(1, OUTPUT);
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);

pinMode(6, INPUT); // initialize digital inputs as an input.
pinMode(7, INPUT);

Serial.begin(9600); // initialize TTL-RS-232.
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}

// prints title with ending line break
Serial.println("STG-800 I/O-Test");

// Write content to the EEPROM
for ( int I=0; I<10; I++ )
EEPROM.write(I, I);
Serial.println("EEPROM written");
// Read it back to the TTL-RS-232
for ( int I=0; I<10; I++ )
{
Serial.print(EEPROM.read(I));
Serial.print(" ");
}
Serial.println("");

}

// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait for 100 milli second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(100); // wait for 100 milli second

// Read and display analog input values
for ( int I = 0; I < 3; I++ )
{
Val = analogRead(A0 + I);
Serial.print(Val);
Serial.print(" ");
}
Serial.print(" - ");

// Read and display digital input values
for ( int I = 0; I < 2; I++ )
{
Val = digitalRead(inPin + I);
Serial.print(Val);
Serial.print(" ");
}

// Clear all outputs
for ( int I = 0; I < 4; I++ )
{
digitalWrite(I, LOW);
}

// Set one output channel dependig from the voltage on analog input 1
Channel = analogRead(A0) / 40;
if ( Channel > 3 )
Channel = 3;
digitalWrite(Channel, HIGH);
Serial.print(" - ");
Serial.print(Channel);

// Output PWM with DC depending from the voltage on analog input 1
Channel = analogRead(A0) / 2;
analogWrite(4, Channel); // 0..255


Serial.println("");



delay(500); // wait 500 milli second
}
101 changes: 101 additions & 0 deletions Examples/STG810.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
/*
STG-810 sample code
For more informations, see https://www.barth-elektronik.com for more informations
This example code is open source.
created 7. Aug 2017
*/

#include <EEPROM.h>

int inPin = 6; // first digital pin
int Val = 0;
int Channel = 0;

// the setup function runs once when you press reset or power the board
void setup() {

pinMode(LED_BUILTIN, OUTPUT); // initialize digital pin LED_BUILTIN as an output.

pinMode(0, OUTPUT); // initialize High and Low side digital outputs as an output.
pinMode(1, OUTPUT);
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);

pinMode(6, INPUT); // initialize digital inputs as an input.
pinMode(7, INPUT);

Serial.begin(9600); // initialize TTL-RS-232.
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}

// prints title with ending line break
Serial.println("STG-810 I/O-Test");

// Write content to the EEPROM
for ( int I=0; I<10; I++ )
EEPROM.write(I, I);
Serial.println("EEPROM written");
// Read it back to the TTL-RS-232
for ( int I=0; I<10; I++ )
{
Serial.print(EEPROM.read(I));
Serial.print(" ");
}
Serial.println("");

}

// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait for 100 milli second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(100); // wait for 100 milli second

// Read and display analog input values
for ( int I = 0; I < 3; I++ )
{
Val = analogRead(A0 + I);
Serial.print(Val);
Serial.print(" ");
}
Serial.print(" - ");

// Read and display digital input values
for ( int I = 0; I < 2; I++ )
{
Val = digitalRead(inPin + I);
Serial.print(Val);
Serial.print(" ");
}

// Clear all outputs
for ( int I = 0; I < 4; I++ )
{
digitalWrite(I, LOW);
}

// Set one output channel dependig from the voltage on analog input 1
Channel = analogRead(A0) / 40;
if ( Channel > 3 )
Channel = 3;
digitalWrite(Channel, HIGH);
Serial.print(" - ");
Serial.print(Channel);

// Output PWM with DC depending from the voltage on analog input 1
Channel = analogRead(A0) / 2;
analogWrite(4, Channel); // 0..255


Serial.println("");



delay(500); // wait 500 milli second
}
101 changes: 101 additions & 0 deletions Examples/STG820.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
/*
STG-820 sample code
For more informations, see https://www.barth-elektronik.com for more informations
This example code is open source.
created 7. Aug 2017
*/

#include <EEPROM.h>

int inPin = 6; // first digital pin
int Val = 0;
int Channel = 0;

// the setup function runs once when you press reset or power the board
void setup() {

pinMode(LED_BUILTIN, OUTPUT); // initialize digital pin LED_BUILTIN as an output.

pinMode(0, OUTPUT); // initialize High and Low side digital outputs as an output.
pinMode(1, OUTPUT);
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT); // initialize alalog outputs as an output.

pinMode(6, INPUT); // initialize digital inputs as an input.
pinMode(7, INPUT);

Serial.begin(9600); // initialize TTL-RS-232.
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}

// prints title with ending line break
Serial.println("STG-820 I/O-Test");

// Write content to the EEPROM
for ( int I=0; I<10; I++ )
EEPROM.write(I, I);
Serial.println("EEPROM written");
// Read it back to the TTL-RS-232
for ( int I=0; I<10; I++ )
{
Serial.print(EEPROM.read(I));
Serial.print(" ");
}
Serial.println("");

}

// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait for 100 milli second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(100); // wait for 100 milli second

// Read and display analog input values
for ( int I = 0; I < 3; I++ )
{
Val = analogRead(A0 + I);
Serial.print(Val);
Serial.print(" ");
}
Serial.print(" - ");

// Read and display digital input values
for ( int I = 0; I < 2; I++ )
{
Val = digitalRead(inPin + I);
Serial.print(Val);
Serial.print(" ");
}

// Clear all outputs
for ( int I = 0; I < 4; I++ )
{
digitalWrite(I, LOW);
}

// Set one output channel dependig from the voltage on analog input 1
Channel = analogRead(A0) / 40;
if ( Channel > 3 )
Channel = 3;
digitalWrite(Channel, HIGH);
Serial.print(" - ");
Serial.print(Channel);

// Output analog voltage depending from the voltage on analog input 1
Channel = analogRead(A0) / 2;
analogWrite(4, Channel); // 0..255


Serial.println("");



delay(500); // wait 500 milli second
}
Loading

0 comments on commit 94fa19a

Please sign in to comment.