mirror of
https://github.com/RobTillaart/Arduino.git
synced 2024-09-19 16:46:11 -04:00
0.1.3 optoma
This commit is contained in:
parent
ae5318b131
commit
59cf47f86e
@ -2,6 +2,10 @@ compile:
|
||||
# Choosing to run compilation tests on 2 different Arduino platforms
|
||||
platforms:
|
||||
- uno
|
||||
- leonardo
|
||||
- due
|
||||
- zero
|
||||
# - leonardo
|
||||
# - m4
|
||||
- esp32
|
||||
- esp8266
|
||||
- mega2560
|
||||
|
@ -4,10 +4,14 @@ name: Arduino CI
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
arduino_ci:
|
||||
runTest:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: Arduino-CI/action@master
|
||||
# Arduino-CI/action@v0.1.1
|
||||
- uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: 2.6
|
||||
- run: |
|
||||
gem install arduino_ci
|
||||
arduino_ci.rb
|
||||
|
@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017-2021 Rob Tillaart
|
||||
Copyright (c) 2017-2022 Rob Tillaart
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -1,19 +1,23 @@
|
||||
|
||||
[![Arduino CI](https://github.com/RobTillaart/Optoma/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci)
|
||||
[![Arduino-lint](https://github.com/RobTillaart/Optoma/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/Optoma/actions/workflows/arduino-lint.yml)
|
||||
[![JSON check](https://github.com/RobTillaart/Optoma/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/Optoma/actions/workflows/jsoncheck.yml)
|
||||
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/Optoma/blob/master/LICENSE)
|
||||
[![GitHub release](https://img.shields.io/github/release/RobTillaart/Optoma.svg?maxAge=3600)](https://github.com/RobTillaart/Optoma/releases)
|
||||
|
||||
|
||||
# Optoma
|
||||
|
||||
Arduino library to control Optoma W305ST beamer over RS232.
|
||||
|
||||
|
||||
## Description
|
||||
|
||||
The Optoma library contains functions that help to control
|
||||
the beamer from an Arduino.
|
||||
|
||||
The library is tested with an UNO and an Optoma W305ST Beamer.
|
||||
The commands can work on other Optoma Beamers
|
||||
The commands can work on other Optoma Beamers.
|
||||
|
||||
Command structure
|
||||
```
|
||||
@ -27,26 +31,26 @@ Command structure
|
||||
\r end command
|
||||
```
|
||||
|
||||
|
||||
## Interface
|
||||
|
||||
The following functions are implemented:
|
||||
|
||||
- **Optoma(HardwareSerial = Serial)** constructor, default uses Serial,
|
||||
- **Optoma(HardwareSerial\* stream = &Serial)** constructor, default uses Serial,
|
||||
other HW or SW Serial are possible.
|
||||
- **init(ID, baudrate)** default baudrate = 9600.
|
||||
- **void init(int ID, uint32_t baudRate = 9600)** default baud rate = 9600.
|
||||
The ID is used to address a specific beamer.
|
||||
In theory one could have multiple beamers on one RS232 port (never seen or tested)
|
||||
- **switchOn()** idem
|
||||
- **switchOff()** idem
|
||||
- **increaseVKS()** VKS - Vertical KeyStone
|
||||
- **decreaseVKS()** VKS - Vertical KeyStone
|
||||
In theory one could have multiple beamers on one RS232 port (never seen or tested).
|
||||
- **uint32_t getBaudrate()** return set baud rate.
|
||||
- **void switchOn()** idem.
|
||||
- **void switchOff()** idem.
|
||||
- **bool isOn()** idem.
|
||||
- **void increaseVKS()** VKS - Vertical KeyStone. check datasheet.
|
||||
- **void decreaseVKS()** VKS - Vertical KeyStone. check datasheet.
|
||||
|
||||
|
||||
## Future
|
||||
|
||||
- More functionality will be added on a need to basis.
|
||||
- Create examples.
|
||||
|
||||
## Operation
|
||||
|
||||
Straightforward
|
||||
|
||||
|
@ -1,19 +1,19 @@
|
||||
//
|
||||
// FILE: optoma_test.ino
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.1.0
|
||||
// PURPOSE: demo vertical keystone.
|
||||
// DATE: 2020
|
||||
// (c) : MIT
|
||||
//
|
||||
|
||||
// Test with TeraTerm or an Optoma beamer)
|
||||
// TeraTerm: Newline Receive mode = CR + LF + 9600 baud.
|
||||
|
||||
|
||||
#include "optoma.h"
|
||||
|
||||
Optoma beamer;
|
||||
|
||||
|
||||
void setup()
|
||||
{
|
||||
beamer.init(22);
|
||||
@ -35,7 +35,11 @@ void setup()
|
||||
beamer.switchOff();
|
||||
}
|
||||
|
||||
|
||||
void loop()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// -- END OF FILE --
|
||||
|
||||
}
|
@ -1,14 +1,21 @@
|
||||
# Syntax Coloring Map for optoma Beamer class
|
||||
# Syntax Colouring Map for Optoma Beamer class
|
||||
|
||||
# Datatypes (KEYWORD1)
|
||||
# Data types (KEYWORD1)
|
||||
Optoma KEYWORD1
|
||||
|
||||
|
||||
# Methods and Functions (KEYWORD2)
|
||||
init KEYWORD2
|
||||
getBaudrate KEYWORD2
|
||||
|
||||
switchOn KEYWORD2
|
||||
switchOff KEYWORD2
|
||||
|
||||
isOn KEYWORD2
|
||||
increaseVKS KEYWORD2
|
||||
decreaseVKS KEYWORD2
|
||||
|
||||
# Constants (LITERAL1)
|
||||
|
||||
# Constants (LITERAL1)
|
||||
OPTOMA_LIB_VERSION LITERAL1
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "Optoma",
|
||||
"keywords": "Trapezium beamer",
|
||||
"keywords": "Trapezium,beamer",
|
||||
"description": "Arduino library to control Optoma W305ST beamer over RS232.",
|
||||
"authors":
|
||||
[
|
||||
@ -15,8 +15,9 @@
|
||||
"type": "git",
|
||||
"url": "https://github.com/RobTillaart/Optoma"
|
||||
},
|
||||
"version": "0.1.2",
|
||||
"version": "0.1.3",
|
||||
"license": "MIT",
|
||||
"frameworks": "arduino",
|
||||
"platforms": "*"
|
||||
"platforms": "*",
|
||||
"headers": "optoma.h"
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
name=optoma
|
||||
version=0.1.2
|
||||
version=0.1.3
|
||||
author=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
sentence=Arduino library to control Optoma W305ST beamer over RS232.
|
||||
|
@ -1,23 +1,27 @@
|
||||
//
|
||||
// FILE: optoma.cpp
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.1.2
|
||||
// VERSION: 0.1.3
|
||||
// DATE: 2017-11-27
|
||||
// PUPROSE: Arduino library to control Optoma W305ST beamer over RS232.
|
||||
// PUPROSE: Arduino library to control Optoma W305ST beamer over RS232.
|
||||
// URL: https://github.com/RobTillaart/optoma
|
||||
//
|
||||
// HISTORY
|
||||
// 0.1.0 2017-11-27 initial version
|
||||
// 0.1.1 2020-07-09 initial release
|
||||
// 0.1.2 2020-01-02 arduino-CI
|
||||
// 0.1.2 2020-01-02 Arduino-CI
|
||||
// 0.1.3 2021-12-22 update library.json, license, readme, minor edits
|
||||
|
||||
|
||||
#include "optoma.h"
|
||||
|
||||
|
||||
Optoma::Optoma(HardwareSerial* stream)
|
||||
{
|
||||
_stream = stream;
|
||||
}
|
||||
|
||||
|
||||
void Optoma::init(int ID, uint32_t baudRate)
|
||||
{
|
||||
_ID = ID;
|
||||
@ -27,6 +31,7 @@ void Optoma::init(int ID, uint32_t baudRate)
|
||||
_stream->print("\r");
|
||||
}
|
||||
|
||||
|
||||
void Optoma::switchOn()
|
||||
{
|
||||
sendID();
|
||||
@ -34,6 +39,7 @@ void Optoma::switchOn()
|
||||
_on = true;
|
||||
};
|
||||
|
||||
|
||||
void Optoma::switchOff()
|
||||
{
|
||||
sendID();
|
||||
@ -41,23 +47,27 @@ void Optoma::switchOff()
|
||||
_on = false;
|
||||
};
|
||||
|
||||
|
||||
void Optoma::increaseVKS()
|
||||
{
|
||||
sendID();
|
||||
_stream->print(F("140 15\r"));
|
||||
};
|
||||
|
||||
|
||||
void Optoma::decreaseVKS()
|
||||
{
|
||||
sendID();
|
||||
_stream->print(F("140 16\r"));
|
||||
};
|
||||
|
||||
|
||||
bool Optoma::isOn()
|
||||
{
|
||||
return _on;
|
||||
};
|
||||
|
||||
|
||||
void Optoma::sendID()
|
||||
{
|
||||
_stream->print('~');
|
||||
@ -65,4 +75,6 @@ void Optoma::sendID()
|
||||
_stream->print(_ID);
|
||||
}
|
||||
|
||||
|
||||
// -- END OF FILE --
|
||||
|
||||
|
@ -2,13 +2,17 @@
|
||||
//
|
||||
// FILE: Optoma.h
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.1.2
|
||||
// VERSION: 0.1.3
|
||||
// DATE: 2017-11-27
|
||||
// PUPROSE: Arduino library to control Optoma W305ST beamer over RS232.
|
||||
// PUPROSE: Arduino library to control Optoma W305ST beamer over RS232.
|
||||
// URL: https://github.com/RobTillaart/Optoma
|
||||
|
||||
|
||||
#include "Arduino.h"
|
||||
|
||||
#define OPTOMA_LIB_VERSION (F("0.1.3"))
|
||||
|
||||
|
||||
class Optoma
|
||||
{
|
||||
public:
|
||||
@ -22,17 +26,19 @@ public:
|
||||
bool isOn();
|
||||
|
||||
// VKS = Vertical KeyStone
|
||||
void increaseVKS();
|
||||
void increaseVKS();
|
||||
void decreaseVKS();
|
||||
|
||||
private:
|
||||
HardwareSerial* _stream;
|
||||
|
||||
int _ID = 0;
|
||||
bool _on = false;
|
||||
uint32_t _baudrate = 9600;
|
||||
|
||||
void sendID();
|
||||
|
||||
};
|
||||
|
||||
|
||||
// -- END OF FILE --
|
||||
|
||||
|
@ -29,6 +29,7 @@
|
||||
// assertNAN(arg); // isnan(a)
|
||||
// assertNotNAN(arg); // !isnan(a)
|
||||
|
||||
|
||||
#include <ArduinoUnitTests.h>
|
||||
|
||||
|
||||
@ -38,29 +39,16 @@
|
||||
|
||||
unittest_setup()
|
||||
{
|
||||
fprintf(stderr, "OPTOMA_LIB_VERSION: %s\n", (char *) OPTOMA_LIB_VERSION);
|
||||
}
|
||||
|
||||
unittest_teardown()
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
unittest(test_new_operator)
|
||||
{
|
||||
assertEqualINF(exp(800));
|
||||
assertEqualINF(0.0/0.0);
|
||||
assertEqualINF(42);
|
||||
|
||||
assertEqualNAN(INFINITY - INFINITY);
|
||||
assertEqualNAN(0.0/0.0);
|
||||
assertEqualNAN(42);
|
||||
}
|
||||
*/
|
||||
|
||||
unittest(test_constructor)
|
||||
{
|
||||
fprintf(stderr, "VERSION: %s\n", "-");
|
||||
|
||||
Optoma beamer;
|
||||
|
||||
beamer.init(22);
|
||||
|
Loading…
Reference in New Issue
Block a user