Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Week 10 Dis
- tutorials: read 1 and 5
- ls /dev/cu.usbserial-A903UMLP
- edison login: root
- configure edison setup
- 1. delete your password
- 2. flash Edison
- to quit: ctrl+A:quit
- part 1:
- replace analog read to mraa_aioread
- strftime()
- size_t strftime(char *s, size_t max, const char *format, const struct tm *tm);
- struct tm *localtime(const time_t *timep);
- time_t time_1 = time();
- struct tm *time_2 = localtime(&time_1);
- strftime(time_str, 8, "%H:%M:%S", time_2);
- after every fprintf: fflush(file)
- http://man7.org/linux/man-pages/man3/strftime.3.html
- http://man7.org/linux/man-pages/man2/time.2.html
- http://wiki.seeed.cc/Grove-Temperature_Sensor_V1.2/
- include newline after temperature number
- turn off: call exit
- stop: log it as a valid command, dont do anything else
- SCALE=F (no space between)
- change frequency: no space around FREQ=2400
- Implementation 1:
- Thread 1:
- 1. collect data
- sleep(int)
- if(!stop){
- collect data & send
- }
- sleep(int)
- Thread 2:
- read socket
- Implementation 2:
- 1. collect data
- 2. send to server, select function, monitor the select
- http://man7.org/linux/man-pages/man2/select.2.html
- select( /*read from socket readend*/,3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement