RF24
SparkFun_MPU-9250_Breakout_Arduino_Library
Our great sponsors
RF24 | SparkFun_MPU-9250_Breakout_Arduino_Library | |
---|---|---|
22 | 1 | |
2,154 | 76 | |
1.7% | - | |
7.4 | 0.0 | |
9 days ago | over 1 year ago | |
C++ | C++ | |
GNU General Public License v3.0 only | - |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
RF24
-
nrf24L01+ scanner porting from cpp to micropython
I started playing around with my pico and an nrf24L01+ module this week and I was thinking to just hack this a bit more, starting from porting the https://github.com/nRF24/RF24/blob/master/examples_pico/scanner.cpp scanner to micropython.
-
I found an easy way to test 2.4GHz downconverters for RTL SDR using a nRF24L01 module
But I didn't know if it worked. I saw a lot of different random signals, but I had no way to know if it was just amplified noise, nor I had a way to know if the downconverter frequency was exactly 2.4GHz, or something else. I have a few cheap nRF24L01 modules around, and plenty of 3.3V Arduino boards, so after a quick read on the nRF24 library (https://github.com/nRF24/RF24), I had a super simple generator running using the carrier wave function of the nRF24.
-
Wireless Communication Between 2 Picos
I'm using C right now with https://nrf24.github.io/RF24/
-
Float values giving overflow
#include //library for transceiver (nrf24l01+ PA+LNA) https://github.com/nRF24/RF24 #include #include #include //library for multiplexer (74HC4067DB) https://github.com/stechio/arduino-ad-mux-lib using namespace admux; #include //library for display (SSD1306 128x64) https://github.com/adafruit/Adafruit_SSD1306 #include //library for I2C const int sig = A3; //signal pin const int s0 = 2; //address pin 0 const int s1 = 3; //address pin 1 const int s2 = 4; //address pin 2 const int s3 = 5; //address pin 3 const int up1pin = 1; //foward left motor const int down1pin = 0; //backwards left motor const int up2pin = 3; //foward right motor const int down2pin = 2; //backwards right motor const int modifierpin = 4; //pwm speed modifier const int trimmerpin = 5; //pwm trimmer const int navlightpin = 6; //navigation lights const int intlightpin = 7; //interior lights const int extlightpin = 8; //exterior lights const int camerapin = 9; //fpv camera const int autoModepin = 10; //autonomous mode const int CE = 9; //radio CE pin const int CSN = 10; //radio CSN pin const byte address[5] = "00001"; //pipe address float latFromSerial; //parsed lattitude from serial input float lonFromSerial; //parsed longitude from serial input float batteryVoltage; //calculated battery voltage float batteryPercentage; //estimated battery charge int timer; //millis timer const int waypointSize = 50; //number of waypoints const PROGMEM float waypoint[waypointSize][2] = { //waypoints for autoMode() {51.966571, 6.2743379}, {51.966772, 6.2744777}, {51.96699149689901, 6.274366197893084}, {51.9671527562416, 6.274120865412113}, {51.96729645199409, 6.273423270736089}, {51.96743080331666, 6.272665240634041}, {51.96754042621848, 6.271857581899409}, {51.96776236209548, 6.270915330645548}, {51.96798193464908, 6.270221004668555}, {51.96828516667115, 6.269413032485236}, {51.96872940066316, 6.268397202672209}, {51.9690764880844, 6.267825125563484}, {51.96951599079974, 6.267264642338533}, {51.97011340024988, 6.266554277598022}, {51.97066084143675, 6.265542763068586}, {51.97101162702417, 6.264465224751552}, {51.97133799766154, 6.263262306712254}, {51.97164036068298, 6.262353231049387}, {51.97207885573615, 6.261205467922246}, {51.97247264722145, 6.260387048788263}, {51.9730446081463, 6.259285804638093}, {51.97348333946684, 6.258252773125921}, {51.97383500264349, 6.257083089055559}, {51.97411491189212, 6.255751674816601}, {51.97421125024911, 6.254641997085617}, {51.97428144275973, 6.253337927743205}, {51.97438642575778, 6.252258957953291}, {51.97461230120062, 6.251185555711}, {51.97496391672023, 6.250073663806153}, {51.97535356652884, 6.249136612734796}, {51.97593199219659, 6.247849009012851}, {51.97673996614692, 6.246219928264511}, {51.97759975319016, 6.244774079377116}, {51.97970812227523, 6.24269840869726}, {51.98056951741261, 6.241148196857345}, {51.98138148466968, 6.238582344717527}, {51.98226488661611, 6.236909516229776}, {51.9828880442564, 6.236150123494202}, {51.98356664827293, 6.235581737840659}, {51.9846292540927, 6.235086763643169}, {51.98620084359441, 6.234541602496764}, {51.9869680375904, 6.233970146843246}, {51.9884155464398, 6.232522126238424}, {51.98950934373955, 6.231079775783453}, {51.99067711020479, 6.229346290429132}, {51.99142243067518, 6.228071305330573}, {51.99218280844037, 6.226417272538562}, {51.99276345055314, 6.224660968088269}, {51.9928317367713, 6.22340383146351}, {51.99303408040588, 6.222658471539628}, }; int waypointCounter = 0; struct values{ //structure for control values bool up1; bool down1; bool up2; bool down2; int trimmer; int modifier; bool navlight; bool intlight; bool extlight; bool camera; bool autoMode; float targetLat; float targetLon; }; struct info{ //structure for answer from boat int autoMode; int battery; int boatHeading; float boatSpeed; int targetDistance; int targetHeading; }; struct values control; //control values struct info answer; //answer from boat Mux mux(Pinset(s0, s1, s2, s3)); //multiplexer object Adafruit_SSD1306 display(128, 64, &Wire, -1); //display object RF24 radio(CE, CSN); //wireless object void setup() { radio.begin(); //start radio service as transmitter radio.setPALevel(RF24_PA_MIN); //transmission power radio.setDataRate(RF24_250KBPS); //data rate radio.enableAckPayload(); //enable ack payloads radio.setRetries(5,5); //delay, count radio.openWritingPipe(address); //set pipe address radio.stopListening(); //stop listening Serial.setTimeout(10); //set timeout for waiting for incoming data Serial.begin(115200); //set serial baudrate if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { Serial.println(F("SSD1306 allocation failed")); for(;;); // Don't proceed, loop forever } delay(2000); //allow startup of display display.clearDisplay(); //clear the display display.setTextSize(1); //standard 1:1 pixel scale display.setTextColor(WHITE); //set white text display.cp437(true); //use full 256 char 'Code Page 437' font control.targetLat = 51.966451; //default target lattitude control.targetLon = 6.274279; //default target longitude } void loop() { if(millis() - timer >= 100){ //activate every 100 milliseconds timer = millis(); //new timestamp mux.signalPin(sig, INPUT_PULLUP, PinType::Digital); //read all digital switches control.up1 = !mux.read(up1pin); control.down1 = !mux.read(down1pin); control.up2 = !mux.read(up2pin); control.down2 = !mux.read(down2pin); control.navlight = !mux.read(navlightpin); control.intlight = !mux.read(intlightpin); control.extlight = !mux.read(extlightpin); control.camera = !mux.read(camerapin); control.autoMode = !mux.read(autoModepin); mux.signalPin(sig, INPUT, PinType::Analog); //read the analog potentiometers control.modifier = mux.read(modifierpin); control.trimmer = mux.read(trimmerpin); /* if(Serial.available()){ //get target location from serial input latFromSerial = Serial.parseFloat(); //read lattitude lonFromSerial = Serial.parseFloat(); //read longitude if(latFromSerial != 0) //only non zero values control.targetLat = latFromSerial; if(lonFromSerial != 0) //only non zero values control.targetLon = lonFromSerial; } */ control.targetLat = waypoint[waypointCounter][0]; //set target waypoint lattitude control.targetLon = waypoint[waypointCounter][1]; //set target waypoint longitude if(answer.autoMode == 1 && waypointCounter < waypointSize-1) //set next waypoint waypointCounter++; if(control.autoMode && control.camera) //if autoMode is activated use trim potmeter and camera button to override waypoint selection waypointCounter = map(control.trimmer, 0, 1023, 0, waypointSize-1); if(radio.write(&control, sizeof(control))){ //send control values Serial.println(F("Data sent successfully")); if(radio.isAckPayloadAvailable()){ //do we get an answer back? radio.read(&answer, sizeof(answer)); //read answer batteryVoltage = (batteryVoltage+(answer.battery*15.0/1023.0))/2.0; //calculate battery voltage (measured as 1/3th with voltage divider) batteryPercentage = (batteryVoltage-11.5)/(13.0-11.5)*100; //estimate battery charge remaining answerToDisplay(); //put all info on oled display } else{ Serial.println(F("Message received but no answer...")); display.clearDisplay(); //display message for no answer from boat display.setCursor(0, 1); display.print("RC Boat: no answer"); display.display(); } Serial.print((control.targetLat)); Serial.print((" ")); Serial.println((control.targetLon)); } else{ Serial.println(F("Data sending failed")); //display message for no connection to boat display.clearDisplay(); display.setCursor(0, 1); display.print("RC Boat: no contact"); display.display(); } } } void answerToDisplay(){ //function for putting answer from boat on display display.clearDisplay(); display.setCursor(0, 1); display.print("RC Boat: connected!"); display.setCursor(0, 15); display.print("Battery: "); display.print(batteryPercentage, 0); display.print("% "); display.print(batteryVoltage, 1); display.print("V"); display.setCursor(0, 29); display.print("Course: "); display.print(answer.boatHeading); display.print((char)248); display.print(" "); display.print(answer.boatSpeed, 1); display.print("km/h"); display.setCursor(0, 43); display.print("AutoMode: "); if(control.autoMode == 1) display.print(answer.autoMode); else display.print("off"); display.print(" "); display.print(waypointCounter); display.setCursor(0, 57); display.print("Target: "); display.print(answer.targetDistance); display.print("m "); if(answer.targetHeading >= 0) display.print("+"); display.print(answer.targetHeading); display.print((char)248); display.display(); }
-
Learning To Program My Epaper Display
I see a few people discussing the same issue on the pi4, if that's not helpful I can look a little deeper after I run to the store.
SparkFun_MPU-9250_Breakout_Arduino_Library
-
Having trouble finding the correct library for this 9DOF IMU, can anyone help
FWIW, my MPU9250 project (Sparkfun MPU9250) took a bit of fiddling to get it going. I used the Sparkfun MPU9250 lib on github. This includes a sample program to debug it. You might also try the alternative address (0x69) just in case they have hooked up AD0 on the MPU9250 (this sets the address).
What are some alternatives?
MicroPython - MicroPython - a lean and efficient Python implementation for microcontrollers and constrained systems
IT8951 - Driver for the IT8951 e-paper controller on Raspberry Pi
TLE5012-Magnetic-Angle-Sensor - This repository includes an library for Arduino for the TLE5012 Magnetic Angle Sensor with SSC interface.
HCSR04 - Arduino library for HC-SR04, HC-SRF05, DYP-ME007, BLJ-ME007Y, JSN-SR04T ultrasonic ranging sensor
MPU6050_light - Lightweight, fast and simple library to communicate with the MPU6050
Adafruit_SSD1306 - Arduino library for SSD1306 monochrome 128x64 and 128x32 OLEDs
mpu6050 - MPU6050 Arduino Library
invensense-imu - Arduino and CMake library for communicating with the InvenSense MPU-6500, MPU-9250 and MPU-9255 nine-axis IMUs.
MPU6050_tockn - Arduino library for easy communication with MPU6050
TFLuna-I2C - Arduino library for the Benewake TFLuna LiDAR distance sensor in the I2C communication mode
Arduino-SDI-12 - An Arduino library for SDI-12 communication with a wide variety of environmental sensors. This library provides a general software solution, without requiring any additional hardware.
arduino-ad-mux-lib - Arduino library for controlling analog/digital multiplexers (A/D mux)