-
Thread
ESP32 A1S Eval
## void setup() { Serial.begin(115200); Serial.println("\r\nReset"); Serial.printf_P(PSTR("Free mem=%d\n"), ESP.getFreeHeap()); Serial.printf("Total heap: %d \r\n", ESP.getHeapSize()); Serial.printf("Free heap: %d \r\n", ESP.getFreeHeap()); Serial.printf("Total PSRAM: %d \r\n"
WL_CONNECTED) { Serial.print("."); delay(100); } wifi_flag = true; Serial.printf_P(PSTR("Connected\r\nRSSI: ")); Serial.print(WiFi.RSSI()); Serial.print(" IP: "); Serial.println(WiFi.localIP()); // Start AC101 Serial.printf("Connect to AC101 codec... "); while (not
-
Thread
Simpeles Menü - Denkfehler
dem zeigerarray arbeiten und einfach lcd_write_P(text_1); schreiben oder lcd_write_P( PSTR(" blubbblubb") ); typisch für lcd_write ist ja : lcd_write( char *string) { while(*string) lcd_data( *string++); } die P ist etwas anders lcd_write_P(const char *string) {
-
Thread
Kleines Problem bei C++ und WinAPI
fahrt_v2 = 5; int fahrt_h2 = 5; int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow) { MSG msg; HWND hWnd; WNDCLASS wc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH); wc.hCursor
-
Thread
LCD an ATmega644 (später ATmega8) mittels TWI/I2C (Anfängergerecht)
true); //lcd_gotolc(0,0); //lcd_print(string1); lcd_gotolc(0,0); lcd_print_P(PSTR("I2CLCD V0.12")); _delay_ms(3000); lcd_command(LCD_DISPLAYON | LCD_CURSOROFF | LCD_BLINKINGOFF); } Leider funktioniert die nicht so wie gehofft. Ich bekomme kryptische Zeichen auf
-
Thread
Hilfe zu DS18S20
LCD die Texte aus, kannst Du erstmal auskommentieren: [c] #if 1 # define TRACE(x) Trace_LCD_P(PSTR(x)) #else # define TRACE(x) #endif [/c] gruß, jetzt geht es an die Daten...
-
Thread
S65 GLCD - wie farbige Icons mittels Font Editor?
gespeichert ist. Du kannst also feste Texte auch direkt aus dem FLASH zeichnen lassen: glcdDrawText(PSTR("Text im FLASH Speicher"), -1, 1); Das optimiert die Speicherverwaltung bei Textkonstanten da diese im Grunde immer im FLASH gespeichert werden aber normalerwiese zum Startup durch den WinAVR GCC
-
Thread
String in char convertieren
"; cout << input << " space " << " was anderes" << endl; [/c] Das ganze kann man noch mit F() PSTR und PROGMEM usw. garnieren, wenn man denn RAM freischaufeln will.
-
Thread
Wie statisches HTML/css/javascript in C/C++ Projekte einbinden?
"<body>404 page not found</body></html>"; server.onNotFound([](){ server.send_P(404, PSTR("text/html"), PAGE_NOT_FOUND); }); [/code] Das funktioniert technisch natürlich einwandfrei. Aber spätestens wenn man hier Javascript einbinden will, das noch interaktiv entwickelt wird, ist es
-
Thread
Atmega644 UART - Komische Ausgabe
dorthin gebracht werden. Schau Dir mal in der Dokumentation zu <avr/pgmspace.h> an, was z.B. der Macro PSTR() tut.
-
Thread
Problem mit C und API (LineTo etc)
**********/ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow) { HWND hWnd; MSG msg; WNDCLASS wc; char szAppName[] = "API Testprogramm"; double time; int wert,wert1; wc.cbClsExtra
-
Thread
AVR - IDE Festplatte liefert immer Fehler beim lesen
LBA-Mode gesetzt wurde? Läuft bei mir so ab: [pre]uint8_t pata_init () { uart_putstring ( PSTR ( "INFO: PATA init start" ), true ); while ( ( !pata_rdy() ) & pata_bsy() ) {} /*set drive 0 to LBA mode*/ write_io_register ( PATA_RW_DEVICE_HEAD_REGISTER, ATA_LBA_DRIVE_0 );
-
Thread
Vektor int32_t mit 200 Stellen global
mischmasch_t m; memcpy_P(&m, mischmasch_array + i, sizeof(*mischmasch_array)); printf_P(PSTR("i = %u, a = %u, b = %i, c = %u, d = %i\n"), i, m.a, m.b, m.c, m.d); } }[/c]
-
Thread
LCD Display funktioniert nicht
automatically storing string constant in program memory */ #define lcd_puts_P(__s) lcd_puts_p(PSTR(__s)) /*@}*/ #endif //LCD_H [/C]
-
Thread
I2C Puffer enthält falsche Werte
Index send buffer to next row if(i == SENDBUFFER-1) { uart_puts_p(PSTR("! Send buffer overloadet\n")); ieCntN = SENDBUFFER; //Not possible to recive instruction at the moment, leave } } } } } ie = ie+6; //Index recive
-
Thread
Frage GCC-Tutorial: EEPROM-Variable auf feste Adressen legen
gcc bzw. mehr oder weniger gleichbedeutend damit Section-Pragmas. Dazu gehören auch PROGMEM, EEMEM, PSTR, ... die die Codeablage regeln (.eeprom, .pgmspace, .bootloader, ...) > Ein Link wäre natürlich das Allerbeste. http://sourceware.org/binutils/docs-2.19/ld/Scripts.html Johann
-
Thread
[Erklärungsbedarf] countdown-demo.zip
int8_t mm = seconds / 60; int8_t ss = seconds % 60; lcd_printInt(mm, 2); lcd_print_P(PSTR(":")); lcd_printInt(ss, 2); } [/c] Doch wie gesagt scheiterte es bei der Durchsicht von countdown.c und die 2 Zeilen, die dafür sorgen, dass nun meine neue sec_16 ebenfalls runtergezählt wird
-
Thread
Umstieg von ATmega16 auf ATmega32
= 0; } if (u8NN == 7) { flagge7 = 1; } // uart_puts_p( PSTR("TimerTick=")); // PrintLongCR( gu32_Ticks ); }; // Tickcounter }; //main loop Ende }; // ******************* MAIN END ******************************************** }[/c]
-
Thread
AVR für wenig Geld im LAN
weiterzuverfolgen. Suche mal nach: char* nPos=strstr_P((char*)ð_buffer[TCP_DATA_START], PSTR("IMES=")); Anbei die Korrekturen für das 1-Wire-Problem Grüße RoBue
weiterzuverfolgen. > > Suche mal nach: > char* nPos=strstr_P((char*)ð_buffer[TCP_DATA_START], > PSTR("IMES=")); Hi RoBue und dann weiter? In etwa so: [c] char* nPos=strstr_P((char*)ð_buffer[TCP_DATA_START], PSTR("SWC0=")); [/c] Wobei SWC0 der Name des Formular-Feldes ist? Gruß Christian
-
Thread
Thread wird nach NutSleep() nicht mehr geweckt
UartReceiveMessage, arg) { NutThreadSetPriority(50); ... for (;;) { printf_P(PSTR(" ------ Thread: UartRxMsg \n")); ... } NutSleep(50); } [/c]
-
Thread
werbserver uip easyweb datenaustausch ethernet arm
application_state *app_state)) { PSOCK_BEGIN(&app_state->socket); PSOCK_SEND_STR_P(&app_state->socket, PSTR("Welcome\n")); PSOCK_END(&app_state->socket); } // Process TCP connection. This is called by inetd in case of events // related to a connection and also periodically. void socketd_appcall
-
Thread
Wechselrichter Hoymiles HM-xxxx 2,4 GhZ Nordic Protokoll?
Hallo, diese Wechselrichter verfügen über einen RF 2,4 GhZ Nordic. Hat jemand eine Idee wie dieses Protokoll aufgebaut ist? Hat jemand das schon einmal "angezapft" um ein eigenes Monitoring ohne deren Cloudzwang zu realsieren? Es gibt offensichtlich einen "Adapter", der das "2,4 GhZ Signal umsetzt und dann via WLAN an deren Cloudsysteme versendet. Google, Hersteller, etc. schweigen sich leider aus. Danke für sachdienliche Hinweise
-
Thread
Schalter PORTC 1-5 C
LcdImage(waitImage); //Bild LcdGotoXYFont(1,4); //Zeile LcdFStr(FONT_1X,(unsigned char*)PSTR("PC Startet...")); //Startet LcdUpdate();// Auf Display _delay_ms(100); LcdClear(); //Bildschirm räumen }*/ DDRC &= ~(1<<DDC1); /* Pin PC1-5 als Eingang */ DDRC &= ~(1<<DDC2);
-
Thread
Atmel AVR - Migration GCC --> IAR Embedded Workbench --> pgmspace function
*********** *******************************************/ #define USART_puts_P(__s) USART_puts_p(PSTR(__s)) void USART_Transmit( char data ) { // Wait for empty transmit buffer while(!(UCSR0A & (1<<UDRE0))) {} // Put data into buffer, sends the data UDR0 = data; } void USART_puts
-
Thread
I2C-, USART-, EEPROM-Test für ein Feedback
bin. Kurz gesagt, änderst du > puts("Es war einmal ein langer String..."); in > puts_p(PSTR("Es war einmal ein langer String...")); Dann wird der String beim Programmstart nicht ins RAM kopiert, sondern direkt aus dem Flash verwendet. Der Zugriff darauf ist ein bisschen langsamer. Oder
-
Thread
Seltsames Verhalten von USB-Seriell-Adaptern
in main(): stdout = stderr = &uart1_str; // standard output to UART1 printf_P (PSTR("*** Klapptriebwerks-Controller Version 0.0 ***\r\n")); [/c] Gruß, Peter
-
Thread
Potentiometer an Mikrocontrollter
"; ....................................... manchmal klemmt es auch in strxx_P Versionen mit PSTR() wann und wo habe ich noch nicht vollständig durchblickt. Auch mag der eine Programmierer lieber const uint8_t pwmtable_11C[] PROGMEM = ...... der Andere aber const uint8_t PROGMEM pwmtable_11C
-
Thread
Fehlerursache bei Displayansteuerung eingrenzen
automatically storing string constant in program memory */ #define lcd_puts_P(__s) lcd_puts_p(PSTR(__s)) /*@}*/ #endif //LCD_H [/c] Danke
-
Thread
GLCD Routinen ( KS0108, HD61202 )
Wert oder unsigned char direkt auf dem display schreiben lassen. Beispiel: lcd_puts_p(small_font,PSTR("1")); schreibt eine 1 auf dem Display. Wie mache ich das, wenn ich jetzt eine unsigned char Variable habe, die den Wert 0x01 -0xff hat um das dynamisch auszugeben? vielen Dank für eure Hilfe,
-
Thread
Single PWM mit PIC18F26, kein ausgangs signal im Simulator am PORTA
Set TMR2 MOVWF T2CON,0 MOVLW 0x1F MOVWF PSTR1CON,0 LOOP NOP ;TEST LOOP GOTO LOOP END
-
Thread
Grafikfähiger LCD Controller für 320x240 LCD mit 4 Graustufen
); lcd_block(180,40,219,75,128,128); lcd_block(200,20,239,50,255,255); lcd_string(10,120,PSTR("320x240 LCD Controller"),255,0); lcd_string(15,140,PSTR("\xB8"" by Benedikt"),255,0); wdt_enable(WDTO_250MS); ENABLE_VLCD=1; }
-
Thread
WinApi Hauptschleife
LPARAM); int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow) { static TCHAR const szAppName[] = TEXT("Klassenname"); HWND hWnd; MSG msg; WNDCLASSEX wndclassex; wndclassex.cbSize = sizeof
-
Thread
Arduino Serial ganze wörter abfragen
MY_EEP_VAR.backlicht])); con_hell_stat(true); } else { sprintf_P(s_out_str, PSTR("hellxx (%d)-(%d)"), MIN_BL, MAX_BL); Serial.println(s_out_str); } } // if( !strcmp(serial_in_command, "hell??") ) } // if( strstr(serial_in_command, "hell") ) #include "c-source\eif_con.c
-
Thread
Lookupstr - Bascom
9600 Dim Strtxt As String * 20 Dim Strtxtbytes(21) As Byte At Strtxt Overlay Declare Sub Slooku pstr(byval Bytpos As Byte , Byref Strtxtbytes(1) As Byte , Byval Bytlen As Byte ) Call Slookupstr(2 , Strtxtbytes(1) , 10) '10 Zeichen Print Strtxt Call Slookupstr(3 , Strtxtbytes(1) , 20) '20 Zeichen
-
Thread
[C & µC] Verwendet ihr printf/scanf?
uart_stdio); stdout = &uart_stdio; printf("Hallo Welt aus dem RAM an stdout!\r\n"); printf_P(PSTR("Hallo Welt aus dem Flash an stdout!\r\n")); fprintf(&uart_stdio, "Hallo Welt an UART!\r\n"); }[/c] Die Standard-IO-Funktionen kümmern sich also darum, dass die zu FILE passende Funktion aufgerufen
-
Thread
undefined reference to 'main'
// ASCII Codes erzeugen lcd_setcursor(0,1); sprintf_P(ram_string, PSTR("In %c: %i"), cEingang, (int)(adc[i]*dAufloesung)); lcd_string(ram_string); // hier sinnvoll } if( get_key_short( 1<<KEY_unten))
-
Thread
LED Glühbirne
Augenempfindlichkeitskurve wodurch man die LER (luminous efficacy of radiation) bekommt. lm/LER=Strahlungsleistung. Pstr/Pel=Wirkungsgrad. Wie Stefanus schon erwähnt hat, wird dieser mit steigendem Strom immer schlechter. Hier kommt dabei in der realen Anwendung auch die Chiperwärmung noch ins Spiel, da man die Temperatur
-
Thread
Programm von mega32 auf mega328P convertieren
code] void sendHeader(uint8_t toAddr, uint8_t myAddress) { char buffer[6]; uartPuts_p(PSTR("@")); uartPuts(uint8ToAh(buffer, toAddr)); uartPuts(uint8ToAh(buffer, myAddress)); } [/code] Ich denke man versteht was ich hier mache. Sowas kommt öfters vor, also verschachtelte Funktionen
-
Thread
Peter Danneggers Bootloader (fastboot) für AVR-GCC-Toolchain
[c] lcdClrscr(); lcdGotoxy(0, 0); lcdWrite_P(PSTR("Loading firmware")); lcdGotoxy(0, 1); lcdWrite_P(PSTR("Please wait... ")); beepOk(); wdt_reset(); wdt_enable(WDTO
-
Thread
Arduino - Speicheroptimierung?
im Quelltext steht. als Parameter zu s(n)printf gehts z.B. nicht, da könnte man auf snprinf_P und PSTR ausweichen, wenn man auch noch die letzten Bytes rausquetschen will. Wolfram F. schrieb im Beitrag #4878840: > link für eine sparsamere SD Library Leider nicht, bin länger nicht mehr mit Arduino
-
Thread
ATtiny85 - bei 3.5kB ist Schluss
Methode anzusprechen. Ja, dann ist es klar wie das funktioniert. Das F Makro legt den String mittels PSTR in den Flash und castet den Pointer um auf einen _FlashStringHelper Pointer. Und dafür gibt es eine print Methode. Wenns für createChar keine entsprechende Methode gibt (und das bezweifle ich mal
-
Thread
WinAVR 20030913 veröffentlicht
()-Formatstrings kannst Du auch beim avr-gcc im ROM haben, Du hast die volle Kontroller: benutze PSTR() und die *_P() Varianten der Funktionen, und schon bist Du dabei. Der Zugriff auf die Strings ist dann naturgemäß langsamer, aber im umgekehrten Falle hättest Du wiederum ja keine Möglichkeit,
-
Thread
LCD an PortC
automatically storing string constant in program memory */ #define lcd_puts_P(__s) lcd_puts_p(PSTR(__s)) /*@}*/ #endif //LCD_H [/c] die avr-includes sind in der main.h
-
Thread
Retro Fieber: Z80 oder 68000 ?
Anpassungen machen: [c] #ifdef unix #include <termio.h> #include <fcntl.h> #define PROGMEM #define PSTR(x) (x) #define pgm_read_byte(s) (*s) #elif defined (DEIN_Z80_KRITERIUM) // NEU #define PROGMEM // NEU #define PSTR(x) (x) // NEU #define pgm_read_byte(s) (*s) // NEU #else #include <avr/io.h> #include <avr/pgmspace.h> #include <avr/interrupt.h
-
Thread
LED_Matrix mit esp32
server address const long gmtOffset_sec = 0; const int daylightOffset_sec = 3600; #ifndef PSTR #define PSTR // Make Arduino Due happy #endif static const uint16_t PROGMEM // These bitmaps were written for a backend that only supported // 4 bits per color with Blue/Green/Red ordering while
-
Artikel
MCURSES
addstr_P. void addstr_P (const char * str) : Zeichenkette aus Flash ausgeben Beispiel: addstr_P (PSTR("Hello, World")); printw. Nur auf STM32 und Unix/Linux verfügbar: void printw (const char *fmt, ...) : Formatierte Ausgabe analog zu printf() Beispiel: printw ("Max. Anzahl Zeilen: %d, Spalten: %d",
char * s) : Zur Position (y,x), dann Zeichenkette aus Flash ausgeben Beispiel: mvaddstr_P (10, 10, PSTR("Hello World")); mvprintw. Nur auf STM32 und Unix/Linux verfügbar: void mvprintw (uint_fast8_t y, uint_fast8_t x, const char *fmt, ...) : Formatierte Ausgabe analog zu printf() Beispiel: printw (10,