MEMS cvičenie 6: Rozdiel medzi revíziami
Zo stránky SensorWiki
| Bez shrnutí editace | |||
| Riadok 27: | Riadok 27: | ||
| [[Súbor:TerminalScreenshot01.png|right]] | [[Súbor:TerminalScreenshot01.png|right]] | ||
| <source lang=" | <source lang="cpp"> | ||
| void setup() | void setup() | ||
| { | { | ||
| Riadok 48: | Riadok 48: | ||
|    Serial.println("Hello, World!"); |    Serial.println("Hello, World!"); | ||
| } | } | ||
| </source> | |||
| [[Súbor:TerminalScreenshot02.png|right]] | [[Súbor:TerminalScreenshot02.png|right]] | ||
| <source lang=" | <source lang="cpp"> | ||
| void setup() | void setup() | ||
Verzia z 10:33, 1. apríl 2016
Oboznámenie so zbernicou i2c
Úlohy:
- Pripojte k procesoru pamäť podľa schémy zapojenia
- Schému upravte tak, aby adresa zariadenia bola ??
- Zapíšte na prvé pamäťové miesto (adresa 0x00) znak 'A'
- Prečítajte, či je znak správne zapísaný
- Prečítajte obsah celej pamäte a vypíšte ho na terminál.
Literatúra
- Official I2C Specification Version 6 http://www.nxp.com/documents/user_manual/UM10204.pdf
- Official List of assigned NXP / Philips I2C addresses http://www.diolan.com/downloads/i2c-address-allocation-table.pdf
- ---
- [ht-ps://www.arduino.cc/en/Reference/Wire Wire Library] Reference
- Serial Library - Print Reference
Datasheets
Pomôcka k Serial Print

void setup()
{
  byte c = 78;
  Serial.begin(9600);
  Serial.print("Hello, World!");
  Serial.println("Hello, World!");
  Serial.println(78);
  Serial.println(c);
  Serial.println('c');
  Serial.println(1.23456);
  Serial.println();
}
void loop()
{
  Serial.println("Hello, World!");
}

void setup()
{
  byte c = 85;      // c = 'U';
  Serial.begin(9600);
  Serial.println(c);
  Serial.println(c, BIN);
  Serial.println(c, DEC);
  Serial.println(c, HEX);
  Serial.println((char)c);
	
  Serial.println();
  Serial.println(1.23456, 0);
  Serial.println(1.23456, 2);
  Serial.println(1.23456, 4);
  Serial.println();
  Serial.print("Temperature = ");
  Serial.print(c);
  Serial.print(' ');
  Serial.write(176);
  Serial.println("C [OK]");
}
void setup()
{
}