Ein Roboter mit bürstenlosem Antrieb, differenzial und NRF24L01 Funk. Großflächig gebaut um ein großes Solarpanel aufzunehmen. https://gitlab.informatik.hs-fulda.de/fdai5253/roboter
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
710 B

4 years ago
  1. //Temperatur <3
  2. void updateTemp(){
  3. if((unsigned long)(millis() - temp_time) >= 1000){ // jede Sekunden
  4. temp_time = millis();
  5. bool err = false;
  6. clearCommands();
  7. commands[0] = getTemp;
  8. radio.write(&commands, sizeof(commands));
  9. unsigned long start = micros();
  10. radio.startListening();
  11. while(!radio.available()){
  12. //Serial.println("nix");
  13. if((millis() - temp_time) >= 10) break;
  14. }
  15. if(/* !err */ true){
  16. int16_t readData;
  17. radio.read(&readData, sizeof(int16_t));
  18. temperature = readData;
  19. }
  20. radio.stopListening();
  21. clearCommands();
  22. }
  23. }