Jump to content
View in the app

A better way to browse. Learn more.

Tinkerunity

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Geschrieben

Hallo,

 

Habe Probleme mit dem Barometer. Ich lese zyklisch den Luftdruck ab und der Wert springt auf einmal um 10mbar nach unten bleibt dann da kurz und geht dann wieder auf den höheren Wert.

Ich habe "Step-Down Power Supply"(12 V) einen Master ( FW 1.3.4 ) und WIFI.

Als Bricklet das Barometer (FW 1.1.0) und LCD 20x4 ( FW 1.1.0 ).

 

Das Programm

# -*- coding: utf-8 -*-


use feature ":5.10";
use strict;
use brick;

STDOUT->autoflush(1);
STDERR->autoflush(1);

# meine Bricks
my $bricks_uid = {
master			=> [ qw/94ANbg9wr7Q/ ],
dc				=> [ qw/9Jk6hqGy1M1/ ],
stepper			=> [ qw/9ekEFBE4X9N 94CZEf7VcxY/ ],
servo			=> [ qw/94ANb31uMYf/ ],
joystick		=> [ qw/9JA/ ],
distance_ir		=> [ qw/9sN/ ],
rotary_poti		=> [ qw/8zQ/ ],
barometer		=> [ qw/bAm/ ],
lcd_20x4		=> [ qw/bfs/ ],
current25		=> [ qw/9AS/ ],
dual_relay		=> [ qw/9T3/ ],
ambient_light	=> [ qw/8So/ ],
analog_in		=> [ qw/9CU/ ],
analog_out		=> [ qw/a2j/ ],
io4				=> [ qw/8Qj/ ],
};

# Initialisierung

my $brickd = brickd->new('192.168.11.105' => 4223 );
my $master = $brickd->new('master',$bricks_uid->{master}->[0],);
my $lcd;
$lcd = $brickd->new('lcd_20x4',$bricks_uid->{lcd_20x4}->[0],{
clear_display => [],
backlight_on => [],
CALLBACK_BUTTON_PRESSED => 
	sub {
		my $butt = shift @_;
		if( $butt == 0 ) {
			$lcd->backlight_off;
			sleep(1) if $^O =~ /Win/i;
			die "not aus@_\n";
		} elsif ( $butt == 1 ) {
			if( $lcd->is_backlight_on ) {
				$lcd->backlight_off;
			} else {
				$lcd->backlight_on;
			}
		}
	},
});
my $baro;
$baro = $brickd->new('barometer',$bricks_uid->{barometer}->[0],{
set_air_pressure_callback_period => 1000, 
CALLBACK_AIR_PRESSURE => 
sub { 
	my $press = shift @_;
	$lcd->write_line(1,0,sprintf("%4.3f mbar",$press / 1000));
	$lcd->write_line(2,0,sprintf("%2.2f C",$baro->get_chip_temperature/100));
},
});

# IP- Test
my @a = $master->get_wifi_status;
my @ip = reverse @{ $a[4]};
$lcd->write_line(0,0,sprintf("IP = %3d.%3d.%3d.%3d",@ip));

# und los
$baro->wait(-1,$lcd);

 

ist taste das Barometer mit 1000 ms ab.

 

Haben das Problem auch noch andere ?

Was ist zu tun ?

Und noch was für TF das ° Zeichen für °C geht auf dem LCD nicht.

 

Armin

Geschrieben

Ich kann das beschriebene Problem reproduzieren. Es hängt mit dem Schreiben aufs LCD zusammen. Dei genau Ursache ist noch nicht klar. Ich untersuche das grade noch.

 

Zum ° Zeichen: Das LCD hat einen speziellen Zeichensatz, der auch in der Dokumentation der write_line Funktion verlinkt ist:

 

https://github.com/Tinkerforge/lcd-20x4-bricklet/raw/master/datasheets/standard_charset.pdf

 

Der Zeichensatz beinhaltet ein Katakana Zeichen, das man als ° Zeichen verwenden kann.

 

Wie zwischen Unicode un dem speziellen LCD Zeichensatz abgebildet werden kann kannst du dem Unicode Beispiel entnehmen:

 

http://www.tinkerforge.com/doc/Software/Bricklets/LCD20x4_Bricklet_C.html#unicode

Geschrieben
  • Autor

sieht gut aus,

Läuft jetzt ca 1h und max Delta ist 0,038 mit 500 ms Abtastung.

 

Armin

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Gast
Reply to this topic...

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.