senseBox Blockly
senseBox-Logo
  1. ›
  2. Galerie

  3. ›
  4. Keksalarm

Keksalarm

Sensors
WIFI
ESPNOW
Ethernet
SD
LED
LED Matrix
Display
openSenseMap
LoRa
Aktivierung
Lora Message
TTN Mapper
Cayenne LPP
Bluetooth
Phyphox
Webserver
MQTT
Logic
Loops
Text
Time
Time control
RTC
NTP
Math
Audio
Variables
Functions
Advanced
Serial
Input/Output
Motors
Watchdog
Initialize DisplayUltrasonic distance sensor at PortA ▾TriggerA1 ▾EchoA2 ▾Max distance250cmintAbstand ▾Show Text/NumberFont colorWhite ▾Fontsize3x-Coordinates0y-Coordinates8ValueintAbstand ▾20≥ ▾220100100Finger weg!Show Text/NumberFont colorWhite ▾Fontsize2x-Coordinates0y-Coordinates15ValuePrint on displayClear DisplaywaitmillisecondsTurn off tone on pin #C5 ▾waitmillisecondsSet tone on pin #C5 ▾at frequencyHzKekse sind in Sicherheit!Show Text/NumberFont colorWhite ▾Fontsize2x-Coordinates0y-Coordinates15ValuePrint on displayClear DisplayTurn off tone on pin #C5 ▾ifdoelseClear DisplayPrint on displaysetintAbstand ▾toArduino run first:Arduino loop forever:
1113000100500100500100TitleUnitTitleUnit01505050150000000latitudelongitudealtitudepDOPfixType10110110001000000000101197011100110022010090
{ }
Arduino Source Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Code generated by senseBox Blockly on Wed Jun 18 2025 11:31:40 GMT+0000 (Coordinated Universal Time)
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h> // http://librarymanager/All#Adafruit_GFX_Library
#include <Adafruit_SSD1306.h> // http://librarymanager/All#Adafruit_SSD1306
#include <NewPing.h> // http://librarymanager/All#NewPing
#define TRIGGER_PIN_IO1_2 1
#define ECHO_PIN_IO1_2 2
#define MAX_DISTANCE_IO1_2 250
int Abstand;
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define OLED_RESET -1
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
NewPing sonarIO1_2(TRIGGER_PIN_IO1_2, ECHO_PIN_IO1_2, MAX_DISTANCE_IO1_2);
void setup() {
  display.begin(SSD1306_SWITCHCAPVCC, 0x3D);
  display.display();
  delay(100);
  display.clearDisplay();
  pinMode(5, OUTPUT);
<>
XML Blocks
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<xml xmlns="https://developers.google.com/blockly/xml" board="null">
  <variables>
    <variable type="int" id="`*CYJbUBz@p(8e{+4*)/">Abstand</variable>
  </variables>
  <block type="arduino_functions" id="QWW|$jB8+*EL;}|#uA" deletable="false" x="43" y="54">
    <statement name="SETUP_FUNC">
      <block type="sensebox_display_beginDisplay" id="ge(L]Q/|[J}L^f5^sI{X"></block>
    </statement>
    <statement name="LOOP_FUNC">
      <block type="variables_set_dynamic" id="8-6c5$o_P:g?rnn6Cmbz">
        <field name="VAR" id="`*CYJbUBz@p(8e{+4*)/" variabletype="int">Abstand</field>
        <value name="VALUE">
          <block type="sensebox_sensor_ultrasonic_ranger" id="-7*%pQPdlS7BUeE1#},.">
            <mutation xmlns="http://www.w3.org/1999/xhtml" port="IO1_2"></mutation>
            <field name="port">IO1_2</field>
            <field name="ultrasonic_trigger">1</field>
            <field name="ultrasonic_echo">2</field>
            <field name="maxDistance">250</field>
            <data>[object Object]</data>
          </block>
        </value>
        <next>
          <block type="sensebox_display_show" id="10#~OJiB%r_ISxz1bkz(">
            <statement name="SHOW">
              <block type="sensebox_display_printDisplay" id="Qe*VY_//d)A?4w2cly`O">
                <field name="COLOR">WHITE,BLACK</field>
                <field name="SIZE">3</field>
                <field name="X">0</field>
                <field name="Y">8</field>
                <value name="printDisplay">
                  <block type="variables_get_dynamic" id="]t$!jZ/)t!O[t.1@apP4">

Information about the Block

Select a Block to show the hint

This website uses cookies to enhance the user experience.
Impressum

|

Privacy

|

News

|

sensebox.de
Menu
    Blockly
    Tutorials
    Gallery
    Code Editor

    Login
    FAQ
    Settings

Which board are you using?

senseBox MCU

senseBox MCU-S2

senseBox MCU:mini

Here you can access the old blockly Version for the Arduino UNO or the senseBox MCU