Arduino

746 readers
16 users here now

All about Arduino boards and programming.

founded 4 years ago
MODERATORS
1
 
 

cross-posted from: https://lemmy.world/post/10852531

Working on a joystick. Seems like any protocol I use to read from peripherals is going to be bottlenecked by having just one input. My microcontroller might have multiple ADCs, but there's just one processor stepping through them. Same for spi, or i2c, or uart. There's really only ever one sensor reporting back its data at a time.

I know this might not matter for measurement resolution. Especially if you're polling at like 115k serial or something, but...

That's 8 bits per axis, and three axis. Now that's at least 34 bits. To sample each axis we're down to only 4.5k samples per second. Plus whatever other cycles the controller has to handle... even if I spent half that time doing microcontrolle cycles at like 2k we're probably still well with the best star craft apms or whatever. I'd still like to find some way to really over engineer this thing.

I read a little about tdm, but that's out of my league and I don't know if you could even have 3 simultaneously signals that way

I'm thinking a microcontroller for each axis, and a usb port for each of them. So it appears like 3 different controllers to the computer. The user would just have to map the axis from the 3 controllers into 1 in their game software. I assume the steam remapping could do this.

Is it just going to get smashed back into one thread in the computer's usb hub anyway?

Any other suggestions?

2
 
 

Crossposted from: https://lemmy.ml/post/9698836

This setup allows Arduino to read temperature, control relay based on setpoints, display info on OLED screen, and manage date/time settings with user input through buttons. Adjust based on specific hardware/project requirements.

Designed to replace the faulty electronic control of a blue heat radiator.

Code and simulation at Wokwi

Licensed under GNU GPLv3.

3
 
 

I have previously used Arduino Leonardo as it supports the keyboard.h library that enables HID keyboard presses. The latest update of the library is from May 5, 2022. Anyone knows if the Uno rev 4 supports the keyboard library?

4
 
 

Hey all,

I've been sitting on a starter kit for a Mega 2560 R3 board and sensors for over a year. I want to get into it, so bad, but I frankly don't have the time to learn to code this with my job the way it is.

Is there a WYSIWYG program anyone favors, especially for someone new to Linux (I'm using a Raspberry Pi 3 Model B running Raspbian and I have a Raspberry Pi 4 Model B too) and Arduino (board model Mega 2560 R3)?

I found these options. Anyone have experience with them?

Visuino

Embrio

5
 
 

(me again) i’m trying to use both WIFI-AP, DO and SPI. But my wifi is not properly working when i let everything run at maximum (required) speed.

TLDR; Seems that pins D1 and D2 interfere with WIFI, but why?

i have a NodeMCU ESP8266 V3 ‘wemos’ variant. (it doesn’t have the ESP-12E board integrated) https://makerselectronics.com/product/wemos-nodemcu-v3-esp8266-340g-wifi-module-with-extra-memory-32m-flash

in setup() i have

  WiFi.softAP(ssid, password);

  IPAddress myIP = WiFi.softAPIP();
  Serial.print("AP IP address: ");
  Serial.println(myIP);

  server.on("/", handleRoot);
  server.on("/set_config", handleForm);
  server.onNotFound(handleNotFound);
  server.begin();
  ..
  t=D1;pinMode(t, OUTPUT); digitalWrite(t, LOW);
  t=D2;pinMode(t, OUTPUT); digitalWrite(t, LOW);
  t=D3;pinMode(t, OUTPUT); digitalWrite(t, LOW);

What i'm seeing;

if i have a main loop() with only

  • while (Serial.available()){ .. }
  • server.handleClient();

Then i can see the AccessPoint and i can connect to it with my Android phone.

When i add code running once every 100 msec

  • Debug setting set to MAX debug info to Serial
  • using pins D1,D2,D3 for output (to LED screen)
  • using D5,D7 for SPI, (to LED screen)
  • having SPISettings(15000000, MSBFIRST, SPI_MODE0)
  • taking total 60 up to 74 microseconds

Then i do see the WIFI AP, and i CAN connect with the WIFI AccessPoint. (But my LED display is flickering)

When i change the code to running once every 10 msec

  • // same as before

Then i CAN connect with the WIFI AccessPoint (But my LED display is flickering)

When i change the code to running once every 10 msec

  • Debug setting off
  • using pins D1,D2,D3 for output
  • using D5,D7 for SPI
  • taking total 60 up to 74 microseconds

Then i CAN connect with the WIFI AccessPoint (But my LED display is flickering)

When i change the code to running once every 1 msec

  • Debug setting None + Debug to serial
  • using pins D1,D2,D3 for output
  • using D5,D7 for SPI
  • taking total 60 up to 74 microseconds

Then i do see the WIFI AP, but i CAN'T connect with the WIFI AccessPoint (But my LED display is showing a steady picture)

When i change the code to running once every 1 msec

  • Debug setting None + Debug disabled
  • using pins D1,D2,D3 for output
  • NOT using D5,D7 for SPI
  • taking total 30 up to 40 microseconds

Then i do NOT see the WIFI AP?!

When i change the code to running once every 1 msec

  • Debug setting None + Debug disabled
  • NOT using pins D1,D2,D3 for output
  • using D5,D7 for SPI
  • taking total 50 up to 70 microseconds

Then i CAN connect with the WIFI AccessPoint?!

Seems one of the pins D1,D2,D3 is interfering with WIFI..

instead of using D1,D2,D3, i changed all I/O to only use D1. Then the WIFI AP does not show up in the WIFI networks.

instead of using D1,D2,D3, i changed all I/O to only use D2. Then the WIFI AP does not show up in the WIFI networks.

instead of using D1,D2,D3, i changed all I/O to only use D3. Then the WIFI AP does show up in the WIFI networks. And i can connect to it.

So my question is; Seems that pins D1 and D2 interfere with WIFI, but why?

6
 
 

cross-posted from: https://lemmy.world/post/2463460

I took a WaveShare RP2040-Touch-LCD-1.28and made a program to use it as a touchscreen. This is still very much in the beta phase but the proof of concept works. Here’s my GitHub repo for it.

I’m planning on integrating it into my next split near the thumb cluster.

7
 
 

I know this is MicroPython, but I was having the same issue through Arduino. The IMU on the WaveShare 1.28 module has a fusion engine but I can’t seem to access it via I2C. More detail in the SO post linked.

8
1
Ambient BD-1 Droid (lemmy.dbzer0.com)
submitted 1 year ago* (last edited 1 year ago) by photonic_sorcerer@lemmy.dbzer0.com to c/arduino@lemmy.ml
 
 

This LEGO STAR WARS BD-1 statue has been tricked out and come alive! With various gadgets, I’ve taught BD-1 to beep and chirp (and, most importantly, turn its lights on) when someone is detected nearby. This is done via a motion sensor attached to BD-1’s left foot. Everything is controlled by an Arduino Nano, and its code lets BD-1 know when to beep so it doesn’t become an annoyance! This can also be set manually via a mute button. But if it’s been a good droid, you can pet it, as it reacts to the outputs of two capacitive touch sensors.

The Adruino is connected to a DFMini MP3-Player, which can play sound files loaded onto an onboard MicroSD card. These soundfiles have been meticulously extracted from the STAR WARS: JEDI: FALLEN ORDER game files. This was only possible thanks to the many hours of volunteer work that has gone into identifying the files.

You can see the code on my github.

Resources used:

Note: I have no affiliation with STAR WARS, Lucasfilm, Disney or LEGO. This project is just for fun, serves no commercial purpose and falls under fair use doctrine. The sound files were extracted from my copy of the game.

9
 
 

Project was to display tide information (time and height) on an LED panel. Fingers crossed the image loads!

OK, it's not an Arduino as such, it's an ESP32, but I programmed it on the arduino IDE. I get the time from an NTP time server and tide data from an API. A bit of messing around with daylight savings times and I display the next four tides on the Hub75 LED matrix. Date and clock is shown on the other side. Every 24 hours I pull new data down and sync the clock.

The good: It works as planned.

The bad: API keys and wifi creds are all hard coded so will need a firmware update if either change. Don't think I have sufficient pins left to allow me to read from an SD card.

The ugly: The wiring behind it is not beautiful. The code could do with a review and tidy. - Maybe even a bit of error handling wouldn't go amiss. Red and Blue are a bit jarring so close together and the blue is a bit swamped , especially when the brightness is turned down.

I may make an enclosure to keep it all together and keep the dust off and add a pir sensor to turn the display off when there's no movement. Or I may get bored and dismantle it!

10
 
 

Modules, chips, and everything in between! What are your favorite sensors?

11
 
 

I did this with a small Arduino uno kit

12
 
 

Seems like a beast to me! I've been thinking of using it for a DIY drums project that needs a lot of analog reads and processing per second.

13
 
 

While not quite Arduino, I have an ESP32 (Arduino IDE) project to pull tide data via API and show it on a HUB75 led matrix. I've got most of the parts working separately but not quite got them all together yet. What is everyone else doing?

14
1
Hey all! (lemmy.ml)
submitted 1 year ago* (last edited 1 year ago) by Ripred@lemmy.ml to c/arduino@lemmy.ml
 
 

I've been here for a couple of weeks or so checking things out. So far so good. Since it looks like we're doing this I wanted to say hi to everyone who's migrating or just perusing.

All the Best!

ripred

15
1
Here from Reddit (lemmy.one)
submitted 1 year ago* (last edited 1 year ago) by YellowGas@lemmy.one to c/arduino@lemmy.ml
 
 

Visiting here from Reddit's r/arduino before the June 12th blackouts. Really liking how Lemmy operates but notice the Arduino community here is less than sparse. Given time, hopefully we can build this community for Arduino enthusiasts who are displeased with Reddit as a platform. I hope to see this place grow over time!

I haven't been a part of the Arduino subreddit for very long - but I've never seen "Africa" performed with stepper motors before! If nothing else, check out the post lower in this community!

16
 
 

While looking into why a stepper motor sometimes makes a sound while stopped, I found.... stepper motor music covers!

17
 
 

If you feel tired about the Arduino IDE and you are fan of terminal. I recommend you to try 'ino' as well as micro as editor.

Ino

Ino is a Python tool to build and upload code to Arduino boards. It is also very lightweight and fully open-source.

  1. Install Ino : pip2 install ino
  2. Create and initialize the project:
mkdir project
cd project
ino init
  1. To configure the settings about the board, you can use the following template: name this file ino.ini and add it into the root folder of your project.
[build]
board-model = mega2560

[upload]
board-model = mega2560
serial-port = /dev/ttyACM1

[serial]
serial-port = /dev/ttyACM1
  1. Code your script by modifying the file src/sketch.ino
  2. Build and upload to the Arduino (using the settings of the file ino.ini) run: ìno build && ino upload

Now each time you want to upload the project to the board you just need to run ino buid && ino upload. Ino will use the configuration of ino.ini to build your app.

Micro

This is not directly linked to Arduino but this is by far my preferred editor for terminal. You can use the shortcuts of nano but you have the customization and the code syntax of vim. The default colorscheme of Micro is gruvbox.

If you want more information about this editor, you can checkout: https://micro-editor.github.io/

Conclusion

I personally love them because I hate the default IDE and I am a big fan of developing app fully in terminal.

What do you think?