senseBox Blockly
senseBox-Logo
  1. ›
  2. Galerie

  3. ›
  4. senseBox Buch - Erfasse deine Umwelt mit Sensoren (Kapitel 3)

senseBox Buch - Erfasse deine Umwelt mit Sensoren (Kapitel 3)

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 DisplayHelligkeit:Light Visible + UVValue:Illuminance in Lux ▾create text withShow Text/NumberFont colorWhite ▾Fontsize1x-Coordinates0y-Coordinates0ValuePrint on displayArduino 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 Sat May 31 2025 07:40:30 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 <LTR329.h>
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define OLED_RESET -1
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
bool lightsensortype = 0; //0 for tsl - 1 for ltr
//settings for LTR sensor
LTR329 LTR;
unsigned char gain = 1;
unsigned char integrationTime = 0;
unsigned char measurementRate = 3;
int read_reg(byte address, uint8_t reg)
{
  int i = 0;
  Wire.beginTransmission(address);
  Wire.write(reg);
  Wire.endTransmission();
  Wire.requestFrom((uint8_t)address, (uint8_t)1);
<>
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">
  <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="2c{8LgLeD8`NM@~04W:r"></block>
    </statement>
    <statement name="LOOP_FUNC">
      <block type="sensebox_display_show" id="=EZ{W!vRJDH+1,5dK;A`">
        <statement name="SHOW">
          <block type="sensebox_display_printDisplay" id="wZu_5b5K6w6|0KK;L#~3">
            <field name="COLOR">WHITE,BLACK</field>
            <field name="SIZE">1</field>
            <field name="X">0</field>
            <field name="Y">0</field>
            <value name="printDisplay">
              <block type="text_join" id=";.7vrb~ArLYZv6DLt+4w">
                <mutation items="2"></mutation>
                <value name="ADD0">
                  <block type="text" id="pTV3WqeeTm9}s|:hp%$7">
                    <field name="TEXT">Helligkeit:</field>
                  </block>
                </value>
                <value name="ADD1">
                  <block type="sensebox_sensor_uv_light" id="gvLIu;1:/ln$5T3bBD7v">
                    <field name="NAME">Illuminance</field>
                    <data>[object Object]</data>
                  </block>
                </value>
              </block>
            </value>
          </block>
        </statement>

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