Advertisement
Guest User

Untitled

a guest
Dec 2nd, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. Week 10 Dis
  2. tutorials: read 1 and 5
  3. ls /dev/cu.usbserial-A903UMLP
  4. edison login: root
  5. configure edison setup
  6.  
  7. 1. delete your password
  8. 2. flash Edison
  9.  
  10. to quit: ctrl+A:quit
  11.  
  12. part 1:
  13. replace analog read to mraa_aioread
  14. strftime()
  15. size_t strftime(char *s, size_t max, const char *format, const struct tm *tm);
  16. struct tm *localtime(const time_t *timep);
  17.  
  18. time_t time_1 = time();
  19. struct tm *time_2 = localtime(&time_1);
  20. strftime(time_str, 8, "%H:%M:%S", time_2);
  21.  
  22. after every fprintf: fflush(file)
  23. http://man7.org/linux/man-pages/man3/strftime.3.html
  24. http://man7.org/linux/man-pages/man2/time.2.html
  25. http://wiki.seeed.cc/Grove-Temperature_Sensor_V1.2/
  26. include newline after temperature number
  27.  
  28. turn off: call exit
  29. stop: log it as a valid command, dont do anything else
  30. SCALE=F (no space between)
  31. change frequency: no space around FREQ=2400
  32.  
  33. Implementation 1:
  34. Thread 1:
  35. 1. collect data
  36. sleep(int)
  37.  
  38.  
  39. if(!stop){
  40. collect data & send
  41. }
  42. sleep(int)
  43.  
  44.  
  45. Thread 2:
  46. read socket
  47.  
  48.  
  49. Implementation 2:
  50. 1. collect data
  51. 2. send to server, select function, monitor the select
  52. http://man7.org/linux/man-pages/man2/select.2.html
  53. select( /*read from socket readend*/,3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement