k7f

Untitled

k7f
Aug 24th, 2014
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.39 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. #define DHT11_PIN 7
  4. #define DHT11_PORT C
  5. #define DHT11_PARSE(port,pin) AS_STRING(P ## port ## pin)
  6. #define DHT11_EVAL(port,pin) DHT11_PARSE(port,pin)
  7. #define DHT11_STRING DHT11_EVAL(DHT11_PORT,DHT11_PIN)
  8. #define AS_STRING( s ) # s
  9.  
  10. void show(const char* s){
  11.     printf("%s\n", s);
  12. }
  13.  
  14. int main()
  15. {
  16.     printf("%s\n", DHT11_STRING);
  17.     show(DHT11_STRING);
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment