-
Notifications
You must be signed in to change notification settings - Fork 2
Wördclock Software Documentation
The Integrated Development Environment that we use is Arduino IDE 1.0.6. It supports development, compiling and upload of the program code. The code is called "arduino sketch". See: http://arduino.cc/en/main/software
Before compiling, download and install the following librarys for the Arduino IDE. See: http://arduino.cc/en/Reference/Libraries
- WS2812B LEDs
- Funkuhr Signal, DCF77
- BH1750 i2c light sensor
- DS1307 RTC
- DHT11 Temp/RH Sensor
- IR Sensor
The sketch supports a lot of serial interfaces:
- Serial: USB-Port
- Serial1: RX- and TX-Pin (0,1)
- BTSerial: SoftwareSerial (any Pin)
The serial communication works with request–response. The user sends a request for some data by a terminal or an application (e.g. Android App). The Arduino responds to the request.
The commands are defined in cmdStrCon.
Now, the following commands are supported:
| Case | Command | Syntax | Example | Description |
|---|---|---|---|---|
| 1 | show | show=0/1 | show=1 | something like a debug mode but not in use |
| 2 | help | help | help | show welcome and help text with this command reference |
| 3 | slb | slb=0...255 | slb=123 | set led brightness (store in SRAM) |
| 4 | glb | glb | glb | get led brightness (get from SRAM) |
| 5 | slbp | slbp | slbp | set led brightness permanent (store in EEPROM) |
| 6 | glbp | glbp | glbp | get led brightness permanent (get from EEPROM) |
| 7 | slc | slc=R,G,B | slc=255,0,255 | set led color, one color for all leds (store in SRAM) |
| 8 | glc | glc | glc | get led color, one color for all leds (get from EEPROM) |
| 9 | slcp | slcp | slcp | set led color permanent, one color for all leds (store in EEPROM) |
| 10 | glcp | glcp | glcp | get led color permanent, one color for all leds (get from EEPROM) |
| 11 | sled | sled=No,R,G,B | sled=11,255,0,255 | set led color (RGB) for a specific led (No) |
| 12 | gled | gled | gled | get led color for all |
| 13 | srtc | srtc=UNIXTIMESTAMP | srtc=1419436598 | set date and time for real time clock via unix time stamp |
| 14 | gtem | gtem | gtem | get temperature from DHT11, if DHT11 is active |
| 15 | ghum | ghum | ghum | get humidity from DHT11, if DHT11 is active |
| 14 | smod | smod=0...n | smod=4 | set the mode by a number |
| 15 | gmod | gmod | gmod | get the number of the selected mode |
All these interfaces are able to send and receive data.
The function serial_com() handles the ports.
The function read_serial() reads the data character by character while the received data are interpreted by the function serial_interprete().
The function write_serial() is used to send an integer value.
The function write_serial_str is used to send characters.
For this purpose, the function serial_com() handles the ports and defines to which port the data are send.