Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

iGNUiCould

Members
  • Joined

  • Last visited

  1. Works for me... Here's some code that uses it to get the readings from a DHT11 sensor. /* * temphumid.c: * Read Temperature / Humidity from DHT11 sensor * -iGNUiCould */ #include <wiringPi.h> #include <stdio.h> #define MAX_TIMINGS 85 #define DHTPIN 7 // GPIO pin for DHT11 data int data[5] = {0, 0, 0, 0, 0}; // Function to read data from DHT11 void readDHT11() { uint8_t lastState = HIGH; uint8_t counter = 0; uint8_t j = 0, i; data[0] = data[1] = data[2] = data[3] = data[4] = 0; // Send start signal to DHT11 pinMode(DHTPIN, OUTPUT); digitalWrite(DHTPIN, LOW); delay(18); digitalWrite(DHTPIN, HIGH); delayMicroseconds(40); pinMode(DHTPIN, INPUT); // Read data from DHT11 for (i = 0; i < MAX_TIMINGS; i++) { counter = 0; while (digitalRead(DHTPIN) == lastState) { counter++; delayMicroseconds(1); if (counter == 255) { break; } } lastState = digitalRead(DHTPIN); if (counter == 255) { break; } // Ignore first 3 transitions if ((i >= 4) && (i % 2 == 0)) { data[j / 8] <<= 1; if (counter > 16) { data[j / 8] |= 1; } j++; } } // Verify checksum and print data if valid if ((j >= 40) && (data[4] == ((data[0] + data[1] + data[2] + data[3]) & 0xFF))) { float humidity = data[0] + data[1] / 10.0; float tempC = data[2] + data[3] / 10.0; float tempF = tempC * 9.0 / 5.0 + 32; printf("Temperature = %.1f°F\n", tempF); printf("Humidity = %.1f%%\n", humidity); } else { printf("Data not valid\n"); } } int main() { if (wiringPiSetup() == -1) { printf("WiringPi setup failed\n"); return -1; } while (1) { readDHT11(); delay(2000); // Wait 2 seconds before reading again } return 0; }
  2. Are you saying the repo I posted is low quality because it doesn't contain a ton of extra code for boards I'm not using? I can remove it for you if you disapprove.
  3. If this is still an issue for anyone, I forked into a repo that is modified to work exclusively with the M4 Zero. Confirmed working on the M4 Zero 4G / 32G model. Should work on other M4 Zero variants as long as the pins are the same. https://github.com/ignuicould/WiringBPi-M4Zero I also have pascal bindings for fpc / Lazarus if anyone is interested.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.