SOFT253 Coursework Weather Reader
Fork of Soft253-WeatherReader by
DataGenerator.cpp@1:8585a8d417dc, 2017-04-21 (annotated)
- Committer:
- Jdumpleton3
- Date:
- Fri Apr 21 17:33:38 2017 +0000
- Revision:
- 1:8585a8d417dc
Get fake data working in putty. Requires PuTTy be correctly setup to list to the COM port.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Jdumpleton3 | 1:8585a8d417dc | 1 | #include <stdlib.h> |
Jdumpleton3 | 1:8585a8d417dc | 2 | #include "DataGenerator.h" |
Jdumpleton3 | 1:8585a8d417dc | 3 | |
Jdumpleton3 | 1:8585a8d417dc | 4 | void DataGenerator::ReadTempHumi(float *pTemp, float *pHumi){ |
Jdumpleton3 | 1:8585a8d417dc | 5 | *pTemp = rand() % 3 + 22; |
Jdumpleton3 | 1:8585a8d417dc | 6 | *pHumi = rand() % 20 + 40; |
Jdumpleton3 | 1:8585a8d417dc | 7 | } |
Jdumpleton3 | 1:8585a8d417dc | 8 | |
Jdumpleton3 | 1:8585a8d417dc | 9 | float DataGenerator::pressure(){ |
Jdumpleton3 | 1:8585a8d417dc | 10 | return (rand() % 20 + 40); |
Jdumpleton3 | 1:8585a8d417dc | 11 | } |
Jdumpleton3 | 1:8585a8d417dc | 12 | |
Jdumpleton3 | 1:8585a8d417dc | 13 | float DataGenerator::temperature(){ |
Jdumpleton3 | 1:8585a8d417dc | 14 | return (rand() % 3 + 22); |
Jdumpleton3 | 1:8585a8d417dc | 15 | } |