senseBox Blockly
senseBox-Logo
  1. ›
  2. Galerie

  3. ›
  4. Personenzähler

Personenzähler

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 distance250cmintdistanz â–¾intpersonen â–¾Show Text/NumberFont colorWhite â–¾Fontsize1x-Coordinates0y-Coordinates10ValueShow Text/NumberFont colorWhite â–¾Fontsize1x-Coordinates0y-Coordinates0Valueintdistanz â–¾40< â–¾booleangesperrt â–¾false â–¾= â–¾and â–¾1true â–¾setbooleangesperrt â–¾toincrease â–¾personen â–¾byintdistanz â–¾40> â–¾booleangesperrt â–¾true â–¾= â–¾and â–¾false â–¾setbooleangesperrt â–¾toifdoifdoPrint on displaysetintdistanz â–¾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 Thu Jun 19 2025 18:01:12 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 distanz;
boolean gesperrt;
#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);
<>
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=";]ot-#[]LRp):y0u|T{/">distanz</variable>
    <variable type="int" id="SG[@p[S263maX)D)~;}H">personen</variable>
    <variable type="boolean" id="9lWlN7$Z?$?okz=d8Z4d">gesperrt</variable>
  </variables>
  <block type="arduino_functions" id="QWW|$jB8+*EL;}|#uA" deletable="false" x="27" y="16">
    <statement name="SETUP_FUNC">
      <block type="sensebox_display_beginDisplay" id="fg!ZevH4#`OjwKrJf;Cf"></block>
    </statement>
    <statement name="LOOP_FUNC">
      <block type="variables_set_dynamic" id="-=YI@{~P)QG[n(HY$PJI">
        <field name="VAR" id=";]ot-#[]LRp):y0u|T{/" variabletype="int">distanz</field>
        <value name="VALUE">
          <block type="sensebox_sensor_ultrasonic_ranger" id="~NyjjEU35tBdsVI(*L0C">
            <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="!PD_L4;))qvq|LUc}WF7">
            <statement name="SHOW">
              <block type="sensebox_display_printDisplay" id="KJl3rJe5`s6c3@i2_ef3">
                <field name="COLOR">WHITE,BLACK</field>
                <field name="SIZE">1</field>
                <field name="X">0</field>
                <field name="Y">0</field>

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