Skip to content

Commit

Permalink
Merge pull request #286 from sensebox/fix/rgbdescriptions
Browse files Browse the repository at this point in the history
Fix/rgbdescriptions
  • Loading branch information
Thiemann96 authored Mar 22, 2024
2 parents 3c5e420 + f67bb6f commit 3dd4ec7
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 26 deletions.
4 changes: 0 additions & 4 deletions src/components/Blockly/blocks/sensebox-led.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ Blockly.Blocks['sensebox_ws2818_led_init'] = {
this.setColour(getColour().sensebox);
this.appendDummyInput()
.appendField(Blockly.Msg.senseBox_ws2818_rgb_led_init)
.appendField("Port:")
.appendField(new Blockly.FieldDropdown(selectedBoard().digitalPinsRGB), "Port")
this.appendValueInput("BRIGHTNESS", "brightness")
.appendField((Blockly.Msg.senseBox_ws2818_rgb_led_brightness));
this.appendValueInput("NUMBER", "number")
Expand All @@ -66,8 +64,6 @@ Blockly.Blocks['sensebox_ws2818_led'] = {
this.setColour(getColour().sensebox);
this.appendDummyInput()
.appendField(Blockly.Msg.senseBox_ws2818_rgb_led)
.appendField("Port:")
.appendField(new Blockly.FieldDropdown(selectedBoard().digitalPinsRGB), "Port")
this.appendValueInput("POSITION", "position")
.appendField((Blockly.Msg.senseBox_ws2818_rgb_led_position));
this.appendValueInput("COLOR", 'Number')
Expand Down
2 changes: 1 addition & 1 deletion src/components/Blockly/generator/sensebox-led.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Blockly.Arduino.sensebox_rgb_led = function () {


Blockly.Arduino.sensebox_ws2818_led_init = function () {
var dropdown_pin = this.getFieldValue('Port');
var dropdown_pin = 1;
var numPixel = Blockly.Arduino.valueToCode(this, 'NUMBER', Blockly.Arduino.ORDER_ATOMIC) || '1';
var brightness = Blockly.Arduino.valueToCode(this, 'BRIGHTNESS', Blockly.Arduino.ORDER_ATOMIC) || '50'
Blockly.Arduino.definitions_['define_rgb_led' + dropdown_pin] = `#include <Adafruit_NeoPixel.h>\n Adafruit_NeoPixel rgb_led_${dropdown_pin}= Adafruit_NeoPixel(${numPixel}, ${dropdown_pin},NEO_GRB + NEO_KHZ800);\n`;
Expand Down
4 changes: 2 additions & 2 deletions src/components/Blockly/msg/de/sensebox-led.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ export const LED = {
/**
* WS2818 RGB LED
*/
senseBox_ws2818_rgb_led: "Setze RGB-LED an",
senseBox_ws2818_rgb_led_init: "RGB LED (WS2818) initialisieren",
senseBox_ws2818_rgb_led: "Setze RGB-LED (onBoard) an",
senseBox_ws2818_rgb_led_init: "RGB LED (onBoard) initialisieren",
senseBox_ws2818_rgb_led_position: "Position",
senseBox_ws2818_rgb_led_brightness: "Helligkeit",
senseBox_ws2818_rgb_led_tooltip:
Expand Down
42 changes: 27 additions & 15 deletions src/components/Blockly/msg/en/sensebox-sensors.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,23 +207,35 @@ The measured values for temperature, humidity and air pressure can be used direc
*/
senseBox_watertemperature: "Water Temperature",


/**
/**
* Feinstaubsensor Sensirion SPS30
*/

senseBox_sps30: "Particulate Matter Sensor (Sensirion SPS30)",
senseBox_sps30_dimension: "in µg/m³",
senseBox_sps30_1p0: "PM1.0",
senseBox_sps30_2p5: "PM2.5",
senseBox_sps30_4p0: "PM4.0",
senseBox_sps30_10p0: "PM10",
senseBox_sps30_tooltip:
"This block gives you the measured value of the Sensirion SPS30 fine dust sensor. Connect the fine dust sensor to one of the 5 **I2C** connectors. Select between PM1.0, PM2.5, PM4.0 and PM10 in the dropdown menu. The measured value will be displayed as **decimal** in µg/m3",
senseBox_sps30_helpurl:
"https://docs.sensebox.de/hardware/sensoren-feinstaub/",

senseBox_esp32_photodiode : "Light intensity",
senseBox_esp32_photodiode_tooltip : "The photodiode measures light intensity in a range from 0 to 4095. The brighter the environment, the higher the value."
senseBox_sps30: "Particulate Matter Sensor (Sensirion SPS30)",
senseBox_sps30_dimension: "in µg/m³",
senseBox_sps30_1p0: "PM1.0",
senseBox_sps30_2p5: "PM2.5",
senseBox_sps30_4p0: "PM4.0",
senseBox_sps30_10p0: "PM10",
senseBox_sps30_tooltip:
"This block gives you the measured value of the Sensirion SPS30 fine dust sensor. Connect the fine dust sensor to one of the 5 **I2C** connectors. Select between PM1.0, PM2.5, PM4.0 and PM10 in the dropdown menu. The measured value will be displayed as **decimal** in µg/m3",
senseBox_sps30_helpurl:
"https://docs.sensebox.de/hardware/sensoren-feinstaub/",

/**
* Photodiode MCUS2(ESP32)
*
*/
senseBox_esp32_photodiode: "Light intensity",
senseBox_esp32_photodiode_tooltip:
"The photodiode measures light intensity in a range from 0 to 4095. The brighter the environment, the higher the value.",

/**
* ToF Imager
*
*/
sensebox_tof_imager: "TOF Imager",
sensebox_tof_imager_tooltip:
"The TOF imager measures distance using infrared light. The measurement value is returned in centimeters.",
sensebox_distanz: "Distance in cm",
};
8 changes: 4 additions & 4 deletions src/components/Blockly/toolbox/ToolboxEsp.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ import * as Blockly from "blockly/core";
<Block type="sensebox_sd_save_for_osem" />
</Category>
<Category name="LED" colour={getColour().sensebox}>
<Label text={Blockly.Msg.toolbox_label_led_ws2812}></Label>
<Block type="sensebox_rgb_led"></Block>
<Block type="sensebox_led" />
<Block type="sensebox_ws2818_led_init">
<Value name="NUMBER">
<Block type="math_number">
Expand Down Expand Up @@ -129,7 +126,10 @@ import * as Blockly from "blockly/core";
</Block>
</Value>
</Block>
<Label text={Blockly.Msg.toolbox_label_led_matrix}></Label>
<Block type="sensebox_rgb_led"></Block>
<Block type="sensebox_led" />
</Category>
<Category name="LED Matrix" colour={getColour().sensebox}>
<Block type="sensebox_ws2812_matrix_init"></Block>
<Block type="sensebox_ws2812_matrix_text" />
<Block type="sensebox_ws2812_matrix_drawPixel" />
Expand Down

0 comments on commit 3dd4ec7

Please sign in to comment.