BOOL FlushFileBuffers(
HANDLE hFile
);
float x = 4.567;
int z = (int) x; // z == 4
#include <math.h>
z = (int) roundf(x); // z == 5
#include <ve_avr.h> // Используется библиотека VE_AVR
#define PIN_OC1A 9 // Пин Digital 9 - OC1A
void setup() {
DEV_TIMER1.setWaveGenMode(TimerW::CTC_OCRA);
DEV_TIMER1.setClockSelect(TimerW::Prescaler_1); // PR = 1
DEV_TIMER1.setOutputCompareA(39); // 16e6/(2*PR*(1+39)) = 200 kHz
DEV_TIMER1.setCompOutModeA(TimerW::Toggle);
pinMode(PIN_OC1A, OUTPUT);
}
void loop()
{
}
client.println(msg);
client.println(" HTTP/1.1");
client.println("Connection: close");
client.print("GET ");
client.print(msg);
client.println(" HTTP/1.1");
client.println("Host: 192.168.10.21");
client.println("Connection: close");
class SomeClass
{
public:
static int m_objectsCounter;
SomeClass() {
++m_objectsCounter;
}
virtual ~SomeClass() {
--m_objectsCounter;
}
};
SomeClass::m_objectsCounter = 0;
int main()
{
SomeClass x, y, z;
std::cout << SomeClass::m_objectsCounter << std::endl;
// можно и так:
std::cout << y.m_objectsCounter << std::endl;
return 0;
}
class SomeClass
{
public:
static int getSomethingGlobal() {
return somethingGlobal;
}
};
int main()
{
std::cout << SomeClass::getSomethingGlobal() << std::endl;
return 0;
}
void loop()
{
// read the oldest byte in the serial buffer:
while (Serial.available() == 0) {
digitaWrite(blinkPin, HIGH);
delay(100);
digitalWrite(blinkPin, LOW);
delay(200);
}
unsigned char incomingByte = Serial.read();
// if it's a capital H (ASCII 72), turn on the LED:
if (incomingByte == 'H') {
digitalWrite(ledPin, HIGH);
Serial.print('H');
}
else if (incomingByte == 'L') {
digitalWrite(ledPin, LOW);
Serial.print('L');
}
else {
Serial.print(incomingByte);
}
}