Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| other:other [2024/07/08 08:02] – [Steps] formlab | other:other [2025/04/18 03:23] (current) – [Products] formlab | ||
|---|---|---|---|
| Line 174: | Line 174: | ||
| * [[https:// | * [[https:// | ||
| * Radio receiver & transmitter set (433,92Mhz) | * Radio receiver & transmitter set (433,92Mhz) | ||
| + | * Search on Amazon for something like ' | ||
| ==== Info ==== | ==== Info ==== | ||
| Line 217: | Line 218: | ||
| * Open the Arduino Terminal and press On and Off on the remote | * Open the Arduino Terminal and press On and Off on the remote | ||
| * I got back the following info | * I got back the following info | ||
| - | * ON-signal:< | + | * ON-signal: |
| * Code: 30980307 Period: 250 | * Code: 30980307 Period: 250 | ||
| * unit: 0 | * unit: 0 | ||
| * groupBit: 0 | * groupBit: 0 | ||
| - | * switchType: 1</ | + | * switchType: 1 |
| * OFF-signal | * OFF-signal | ||
| * Code: 30980307 Period: 250 | * Code: 30980307 Period: 250 | ||
| Line 227: | Line 228: | ||
| * groupBit: 0 | * groupBit: 0 | ||
| * switchType: 0 | * switchType: 0 | ||
| + | * Open now the example sketch ' | ||
| + | * Change the line: NewRemoteTransmitter transmitter(**123**, | ||
| + | * The big number is the received ' | ||
| + | * Also change the lines in the loop to use only these: | ||
| + | * Switch off with: transmitter.sendUnit(0, | ||
| + | * Switch on with: transmitter.sendUnit(0, | ||
| + | * Then upload the sketch to the Arduino and try it out. The remote socket should switch every 5 seconds. | ||
| + | |||
| + | * Open the Openbuilds Blackbox and change the Relay Jumper from the M3/M5 command config to the M8 M9 config. The M3 command is already used for setting the servo. See the docs [[https:// | ||
| + | * Tested successfully: | ||
| + | |||
| + | This is the code I'm using now: | ||
| + | <code c++> | ||
| + | /* | ||
| + | Plotter auto shutdown 01 | ||
| + | |||
| + | For the Openbuilds Acro pen plotter. | ||
| + | The Gcode sender (Openbuilds Control) will send the following Gcode sequence after finishing a plot: | ||
| + | M8 ; close the relay | ||
| + | G4 P0.2 ; wait 20 MS | ||
| + | M9 ; open the relay | ||
| + | |||
| + | The relay is connected with the arduino nano with a cable. This signal can be detected as if it were a button press | ||
| + | When the arduino received the ' | ||
| + | I'm using the Bounce2 library for debouncing and the NewRemoteTransmitter library for receiving and transmitting the 433Mhz radio remote signals. | ||
| + | |||
| + | Formlab | ||
| + | 08/07/24 | ||
| + | */ | ||
| + | |||
| + | #define BUTTON_PIN 3 | ||
| + | #define LED_PIN 13 | ||
| + | |||
| + | // https:// | ||
| + | #include < | ||
| + | |||
| + | // Create a debouncer instance | ||
| + | Bounce2:: | ||
| + | |||
| + | // https:// | ||
| + | #include < | ||
| + | |||
| + | // Create a transmitter instance | ||
| + | NewRemoteTransmitter transmitter(30980307, | ||
| + | |||
| + | void setup() { | ||
| + | // Button setup | ||
| + | button.attach(BUTTON_PIN, | ||
| + | button.interval(5); | ||
| + | button.setPressedState(LOW); | ||
| + | |||
| + | // LED setup | ||
| + | pinMode(LED_PIN, | ||
| + | } | ||
| + | |||
| + | void loop() { | ||
| + | button.update(); | ||
| + | if (button.pressed()) { | ||
| + | |||
| + | shutdown(); | ||
| + | } | ||
| + | } | ||
| + | |||
| + | |||
| + | void shutdown() { | ||
| + | digitalWrite(LED_PIN, | ||
| + | delay(100); | ||
| + | digitalWrite(LED_PIN, | ||
| + | delay(100); | ||
| + | digitalWrite(LED_PIN, | ||
| + | delay(100); | ||
| + | digitalWrite(LED_PIN, | ||
| + | delay(100); | ||
| + | digitalWrite(LED_PIN, | ||
| + | delay(100); | ||
| + | digitalWrite(LED_PIN, | ||
| + | delay(100); | ||
| + | |||
| + | transmitter.sendUnit(0, | ||
| + | } | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| | | ||