Hi, um das Rad nicht neu zu erfinden, frage ich, wer schon einmal einen Barograph mit AVR verwirklicht hat. Denke dabei an eine AVR der den Drucksensor abfragt und Wert in einem LCD- Display anzeigt 240x64 Angedacht ist ein Arduino Mega Uwe
Habs mal irgendwann so gemacht:
1 | void lcd_rect(uint8_t x,uint8_t y,uint8_t width ,uint8_t height){ |
2 | lcd_line(x,y,x+width-1,y); // Top Line |
3 | lcd_line(x+width-1,y,x+width-1,y+height-1); // Left Line |
4 | lcd_line(x,y+height-1,x+width-1,y+height-1); // Bottom Line |
5 | lcd_line(x,y,x,y+height-1); // Right Line |
6 | |
7 | }
|
8 | |
9 | void lcd_fill_rect(uint8_t x,uint8_t y,uint8_t width,uint8_t height) |
10 | {
|
11 | uint8_t cnt_x,cnt_y; |
12 | for (cnt_y=y;cnt_y<y+height;cnt_y++) |
13 | for (cnt_x=x;cnt_x<x+width;cnt_x++) |
14 | set_pixel(cnt_x,cnt_y); |
15 | |
16 | }
|
17 | |
18 | //Draw simple progressbar, val = 0...100%
|
19 | void lcd_progressbar(uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint8_t val){ |
20 | lcd_rect(x,y,width,height); |
21 | if(val == 0) |
22 | return; |
23 | if(val > 100) |
24 | val = 100; |
25 | lcd_fill_rect(x+2,y+2,(val*1000/(width-4-x))/10,height-4); |
26 | }
|
Hallo Masterfx, danke für die Antwort, mit der ich allerdings ( zum jetzigen Zeitpunkt) nicht viel anfangen kann. Zu klären wäre zuerst, Welcher Baro Sensor, welcher AVR und LCD. Gruß Uwe
Naja ich würde den mpl3115a2 nehmen. Der ist schön genau und macht die ganze Kompensation für dich. Kostet auch nur <3€. Ich hatte dich auch falsch verstanden. Meine Routine zeichnet ja nur eine "progressbar". Du willst wahrscheinlich nur eine Linie vom Luftdruck über einen gewissen Zeitraum zeichnen. Da brauchst du im Prinzip nur "set_pixel"
:
Bearbeitet durch User
Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.