tuxmartin

prirazeni pole

Jan 7th, 2015
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1. struct Teplomer {
  2.   byte DS18B20ID[9];
  3.   float zmereno;
  4.   float maByt;    
  5. };
  6.  
  7. struct Teplomer;
  8. Teplomer s[2];
  9.  
  10. void setup() {
  11.   Serial.begin(9600);
  12.   s[0].maByt=23.0;
  13.   byte a[9] = {0x28, 0x2E, 0x95, 0xC7, 0x1, 0x0, 0x0, 0xCA};
  14.   priradPole(a, s[0].DS18B20ID);
  15.  
  16.   for (byte i=0; i<8; i++) {
  17.     Serial.println(s[0].DS18B20ID[i], HEX);
  18.   }
  19. }
  20.  
  21. void loop() {
  22. }
  23.  
  24. void priradPole(byte co[], byte kam[]) {
  25.   byte velikostPole = sizeof(co)/sizeof(*co);
  26.   for (byte i=0; i<9; i++) {
  27.     kam[i] = co[i];
  28.   }  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment