Skip to content
This repository was archived by the owner on Jul 19, 2018. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Language: Cpp
BasedOnStyle: LLVM
UseTab: Never
IndentWidth: 2
AlignConsecutiveDeclarations: true
AllowShortFunctionsOnASingleLine: false
BreakBeforeBraces: Custom
BraceWrapping:
AfterControlStatement: false
AfterFunction: false
AfterClass: true
AfterEnum: true
BeforeElse: false
ReflowComments: false
PointerAlignment: Left
29 changes: 1 addition & 28 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,28 +1 @@
# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app
*~
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
all:
echo "nothing to do"

style:
clang-format \
-style=file \
-i \
*.cpp \
*.h \
examples/*/*.ino
62 changes: 28 additions & 34 deletions examples/HelloWorld/HelloWorld.ino
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,44 @@
#define redLed 3
#define greenLed 4

Max7456 osd;
Max7456 osd;
unsigned long counter = 0;
byte tab[]={0xC8,0xC9};
byte tab[] = {0xC8, 0xC9};

void setup()
{
void setup() {
SPI.begin();

osd.init(10);
osd.setDisplayOffsets(60,18);
osd.setDisplayOffsets(60, 18);
osd.setBlinkParams(_8fields, _BT_BT);

osd.activateOSD();
osd.printMax7456Char(0x01,0,1);
osd.print("Hello world :)",1,3);
osd.print("Current Arduino time :",1,4);

osd.printMax7456Char(0xD1,9,6,true);
osd.print("00'00\"",10,6);
osd.printMax7456Chars(tab,2,12,7);
pinMode(redLed,OUTPUT);
pinMode(greenLed,OUTPUT);
osd.printMax7456Char(0x01, 0, 1);
osd.print("Hello world :)", 1, 3);
osd.print("Current Arduino time :", 1, 4);

osd.printMax7456Char(0xD1, 9, 6, true);
osd.print("00'00\"", 10, 6);
osd.printMax7456Chars(tab, 2, 12, 7);
pinMode(redLed, OUTPUT);
pinMode(greenLed, OUTPUT);

//base time = 160ms,time on = time off.
}


void loop()
{
if(counter%2 == 0)
{
digitalWrite(redLed,LOW);
digitalWrite(greenLed,HIGH);
}
else
{
digitalWrite(redLed,HIGH);
digitalWrite(greenLed,LOW);
void loop() {
if (counter % 2 == 0) {
digitalWrite(redLed, LOW);
digitalWrite(greenLed, HIGH);
} else {
digitalWrite(redLed, HIGH);
digitalWrite(greenLed, LOW);
}

counter = millis()/1000;
osd.print(int(counter/60),10,6,2,0,false,true);
osd.print(int(counter%60),13,6,2,0,false,true);
counter = millis() / 1000;

osd.print(int(counter / 60), 10, 6, 2, 0, false, true);
osd.print(int(counter % 60), 13, 6, 2, 0, false, true);

delay(100);
}
1,190 changes: 1,170 additions & 20 deletions examples/Max7456Write/Max7456Write.ino

Large diffs are not rendered by default.

65 changes: 0 additions & 65 deletions examples/Max7456Write/Max7456Write.ino~

This file was deleted.

Loading