- AuthorPosts
I need help using the Stone library.
I have a stone STWI 101 WT Display connected to a Arduino Mega 2560.
I am new to programing for the stone Display.
I am starting with a simple program using a display switch to turn on and off a LED light on pin 13 of the arduino. I need help with the commands needed using the libarary commands.
This is what i get on the arduino serial monitor when i turn the “switch31” on and off.
Wfii Switch off
53 54 3C 10 10 0 9 73 77 69 74 63 68 33 31 0 3E 45 54 4B C4
type:switch;len:9;widget:switch31;value:0;
Wfii Switch on
53 54 3C 10 10 0 9 73 77 69 74 63 68 33 31 1 3E 45 54 B7 C5
type:switch;len:9;widget:switch31;value:1;What “if ” commands do i use in the program to turn the led off and on.
Arduino does not like using “STONER.value”
Here is what i have for a program.
#include “stone.h”
void setup()
{
// initialize digital pin LED_BUILTIN as an output.
Serial.begin(115200);
pinMode(LED_BUILTIN, OUTPUT);
}void loop() {
serial_receive();if (STONER.value! =1) {
digitalWrite(LED_BUILTIN, HIGH);
}
if (STONER.value! =0) {
digitalWrite(LED_BUILTIN, LOW);
}
}Hi,
you must :
1) download stone library at https://github.com/STONElibrary/stone_serial;
2) download “instruction for stone uart library” at https://www.stoneitech.com/download/instructions-for-stone-uart-library/ and follow instructions inside this document for Arduino platform, specially at pages 3,4.
3) you need files described in page 3 otherwise Arduino don’t recognize stone commands.
Regards
- AuthorPosts
- You must be logged in to reply to this topic.