Create String Combining strings Replace String to char Is String Null?
All posts by
.Char based Strings General
Convert String to char array Using a string to call a function that wants a char*
Using Nextion displays with the Arduino
Nextion are a range of HMI displays with built in controller that can be used with any microcontroller via a 2 pin UART interface. We have some resources here. Installing Nextion Arduino Library Download ITEADLIB_Arduino_Nextion from GitHub Rename the “ITEADLIB_Arduino_Nextion-master” folder to “ITEADLIB_Arduino_Nextion”.Move it to your Arduino IDE installation libraries folder. Configuring the library for […]
Arduino UNO
https://store.arduino.cc/arduino-uno-rev3 Microcontroller: ATmega328PIO voltage: 5V IO pin high voltage (for VCC = 5V): min 0.6VCC to max VCC + 0.5So digital IO pins have a nominal high level input range of 3.0V to 5.5V, so are compatible with 3.3V input signals. UART pins RX and TX are marked as the pins that are RX and TX on […]
.DateTime general
Setting DateTime to a value log_date_time_last = (DateTime(2017, 12, 30, 0, 0, 0));
Increasing available memory
To increase available RAM Move constants to program memory instead of RAM Use the F macro to move string literals to program memory. Serial.print("some string") is stored in RAM (dynamic memory), Serial.print(F("some string literal") is stored in program memory. Any function that uses the print class functions can use the F macro (e.g.client.print). Avoid long […]
RAM
Ram used in interrupts Use volatile: volatile byte my_variable_name; Stopping constants using RAM Use the F macro to move string literals to program memory. Serial.print(“some string”) is stored in RAM (dynamic memory), Serial.print(F(“some string literal”) is stored in program memory. Any function that uses the print class functions can use the F macro (e.g.client.print). Use […]
Variables used in interrupts
Declaring a variable which will be used in an interrupt volatile unsigned int my_irq_variable = 0;
UNO-Timer/Counter 1 Interrupt
Using TimerOne Library See here Using Code Initialise Turning interrupt on Turning interrupt off Interrupt function
UNO-Comparator Interrupt
Initialise //Enable gobal interrupts (should already be enabled but do anyway) SREG = SREG | B10000000; Turning interrupt on //Enable analog comparator interrupt ACSR = B00000010; //On failing edge (bit 1=1), AIN0 applied to positive input of the analog comparator (bit6=0) ACSR = ACSR | B00001000; // Enable analog comparator interrupt (bit 3). Turning interrupt […]