Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. void loop ( ) {
  2.  
  3.   int noBytes = Udp.parsePacket();
  4.   String received_command = " ";
  5.  
  6.   if ( noBytes ) {
  7.     Udp.read(packetBuffer,noBytes);
  8.     for (int i=1;i<=noBytes;i++){
  9.     received_command += char(packetBuffer[i - 1];
  10.     }
  11.  
  12.     int dac_value;
  13. dac_value = received_command.toInt(); // str to int
  14.  
  15.     Serial.print("adc value: ");
  16. Serial.println(dac_value);
  17.  
  18. //## how to send dac_value to mcp4725 for take analog out this section !?!? ##
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement