Arduino

6 readers
1 users here now

All about Arduino boards and programming.

founded 4 years ago
MODERATORS
1
 
 

Hello guys! While I am a relatively experienced programmer, I have practically zero experience on the hardware/electronics side of things. I really want and need (I'd like to work in embedded systems) to get this stuff in my "tool belt" of skills, but I am really worried that I will do something wrong or order the wrong parts because it is quite an old project I will be trying to build.

I would like to make this project (EDTracker github) so that i can play all my sim games that benefit from head tracking again. I had one which was pre-built but the connector broke. I would prefer a version with the magnetometer (9150 or 9250). The problem is that due to my inexperience I have no idea where to search for cheap(ish) components, or even if the components listed in the docs are still available or if there are better ones that do the same thing.

I realise this is not much (almost nothing) to go on, but I would really appreciate any help at all that can push me in the right direction. Also, please be understanding of my possibly ignorant questions. When you have no knowledge in a field it is often hard to know what the right questions are :)

Many thanks in advance!

Edit: Spelling

2
 
 

I have recently started working on my school project which involves writing some c++ for the ESP32. At school everything works fine, but at home only the first time I compile and upload the project (using the Arduino IDE), does it actually work correctly. So the communication is there, it just seems that the first compilation step does something to the program, as every time after that first compilation it refuses to compile. Here are the console outputs of the two compilations:

First compilation (successful)[___](WARNUNG: Kategorie '' in der Bibliothek ESP Insights ist ungültig und wird auf 'Uncategorized' festgelegt WARNUNG: Kategorie '' in der Bibliothek ESP RainMaker ist ungültig und wird auf 'Uncategorized' festgelegt WARNUNG: Kategorie '' in der Bibliothek WiFiProv ist ungültig und wird auf 'Uncategorized' festgelegt Der Sketch verwendet 295301 Bytes (22%) des Programmspeicherplatzes. Das Maximum sind 1310720 Bytes. Globale Variablen verwenden 26792 Bytes (8%) des dynamischen Speichers, 300888 Bytes für lokale Variablen verbleiben. Das Maximum sind 327680 Bytes. esptool.py v4.5.1 Serial port /dev/ttyUSB0 Connecting...... Chip is ESP32-D0WDQ6 (revision v1.0) Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None Crystal is 40MHz MAC: 24:0a:c4:58:2a:9c Uploading stub... Running stub... Stub running... Changing baud rate to 921600 Changed. Configuring flash size... Flash will be erased from 0x00001000 to 0x00005fff... Flash will be erased from 0x00008000 to 0x00008fff... Flash will be erased from 0x0000e000 to 0x0000ffff... Flash will be erased from 0x00010000 to 0x00058fff... Compressed 18992 bytes to 13112... Writing at 0x00001000... (100 %) Wrote 18992 bytes (13112 compressed) at 0x00001000 in 0.5 seconds (effective 291.1 kbit/s)... Hash of data verified. Compressed 3072 bytes to 146... Writing at 0x00008000... (100 %) Wrote 3072 bytes (146 compressed) at 0x00008000 in 0.1 seconds (effective 336.8 kbit/s)... Hash of data verified. Compressed 8192 bytes to 47... Writing at 0x0000e000... (100 %) Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 629.9 kbit/s)... Hash of data verified. Compressed 295664 bytes to 165899... Writing at 0x00010000... (9 %) Writing at 0x0001af40... (18 %) Writing at 0x000242c6... (27 %) Writing at 0x00029aae... (36 %) Writing at 0x0002ef0a... (45 %) Writing at 0x000342da... (54 %) Writing at 0x0003a4b6... (63 %) Writing at 0x000447e9... (72 %) Writing at 0x0004c7f4... (81 %) Writing at 0x00051d5d... (90 %) Writing at 0x000576bd... (100 %) Wrote 295664 bytes (165899 compressed) at 0x00010000 in 2.8 seconds (effective 856.4 kbit/s)... Hash of data verified.

Leaving... Hard resetting via RTS pin...)

Second time (fail)WARNUNG: Kategorie '' in der Bibliothek ESP Insights ist ungültig und wird auf 'Uncategorized' festgelegt WARNUNG: Kategorie '' in der Bibliothek ESP RainMaker ist ungültig und wird auf 'Uncategorized' festgelegt WARNUNG: Kategorie '' in der Bibliothek WiFiProv ist ungültig und wird auf 'Uncategorized' festgelegt panic: runtime error: index out of range [7] with length 7

goroutine 1 [running]: arduino.cc/builder.(*includeCache).Next(...) arduino.cc/builder/container_find_includes.go:209 arduino.cc/builder.findIncludesUntilDone(0xc000046c00, 0xc0000b0000, {{0x538340, 0xc0006994a0}, {0xc00019604e, 0x7}}) arduino.cc/builder/container_find_includes.go:321 +0x1190 arduino.cc/builder.(*ContainerFindIncludes).Run(0xc00002e1c0?, 0xc000046c00) arduino.cc/builder/container_find_includes.go:149 +0xbe5 arduino.cc/builder.runCommands(0x38?, {0xc000053c58?, 0x22, 0x415b0b?}, 0x55?) arduino.cc/builder/builder.go:191 +0xda arduino.cc/builder.(*Builder).Run(0x7ffca1319b57?, 0x19?) arduino.cc/builder/builder.go:124 +0x890 arduino.cc/builder.RunBuilder(...) arduino.cc/builder/builder.go:222 main.main() arduino.cc/arduino-builder/main.go:338 +0xa1f arduino-builder gab 2 zurück Fehler beim Kompilieren für das Board ESP32 Dev Module.

As you can tell, these error messages are not English, they are actually German. In the second compile step, they essentially say the following:

arduino-builder returned 2
Error during compilation of the Board ESP32 Dev Module

I am using Debian 12 (GNU/Linux) on my machine, but I don't think that this would be the issue, as I am clearly able to upload the project the first time around.

Has someone here experienced something like this before? I have looked online, and most sources say that the error code was one and not two, so this seems like a different issue.

3
 
 

Hey Made a script to aimbot in aimlab just to challenge myself with learning opencv and color detection. Feel free to use code for your own similar projects!

4
 
 

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.

5
 
 

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?

6
 
 

Hi all, intuitively it seems to make sense to split different parts of code to different files, so it is easier to navigate and read.

For example to have separate files for servos, controllers and web which are included in the main code, and only variables are passed through.

And if this is a good practice, how do you deal with separation of setup and loop parts? I have not found reaources on this, so thinking to ask the community.

7
 
 

(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?

8
 
 

I made a thing. A while ago I set up a raspberry pi to log data from a couple Arduino based sensor sensors I made.

Now I made a control panel type thing, which can show data values via the 4x7 digit display, show what is it displaying via the 6 leds, can send information using the r reader which is enabled/changed via a key switch.

Powered by an Arduino nano (made by grove) and communicates with the server through usb serial.

I am quite happy with it (eventually I'll bother to replace the tape with glue)

9
 
 

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.

10
3
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

11
3
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!

12
 
 

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

13
 
 

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?