#help-with-arduino
1 messages · Page 90 of 1
threshold unknown to me
You start at 0 to learn these things.
Code is easily changeable. Try things out, experiment, and adjust.
True. The first time I ran it with i=0, I saw no movement at all so I thought something was wrong. It only occurred to me later that the i value was probably too low to supply enough voltage to the motor, and needed more time to ramp up
Also, add print statements so you can see on the serial monitor how fast you are attempting to run the motor at each point. It's debugging time.
hey! is there any way of generating PWM output on a non PWM pin? I was just playing around with arduino and thought of this
You can turn the output on and off regularly. You could do this with a timer interrupt (tricky but it works) or a CPU loop (keeps the CPU from doing a lot else while you're generating the waveform)
Actually I want to design a program where I can also change the duty cycle.. i tried with digitalWrite() but obv can also switch between high and low
Like I give an input with the duty cycle and get the desired wave on an oscilloscope
Guys, excuse me, for arduino, where can i get the cstring library?
That's doable. For low frequency, you can just use counting loops or delay() and digitalWrite(). For faster response, you can write directly to the GPIO ports.
Which cstring? The ctypes one, or the C++ support or something else?
the one in this code
#include <ros.h>
#include <std_msgs/String.h>
#include <std_msgs/UInt16.h>
#define BUTTON 8
#define LED 13
ros::NodeHandle node_handle;
std_msgs::String button_msg;
std_msgs::UInt16 led_msg;
void subscriberCallback(const std_msgs::UInt16& led_msg) {
if (led_msg.data == 1) {
digitalWrite(LED, HIGH);
} else {
digitalWrite(LED, LOW);
}
}
ros::Publisher button_publisher("button_press", &button_msg);
ros::Subscriber<std_msgs::UInt16> led_subscriber("toggle_led", &subscriberCallback);
void setup()
{
pinMode(LED, OUTPUT);
pinMode(BUTTON, INPUT);
node_handle.initNode();
node_handle.advertise(button_publisher);
node_handle.subscribe(led_subscriber);
}
void loop()
{
if (digitalRead(BUTTON) == HIGH) {
button_msg.data = "Pressed";
} else {
button_msg.data = "NOT pressed";
}
button_publisher.publish( &button_msg );
node_handle.spinOnce();
delay(100);
}
for ROS
im using ubuntu in a virtual machine if that helps too
Ok I'll try that again. Thanks!
Hello everyone!
I am looking for help on my project. I want to make user friendly version of macro keyboard but dont know how to transfer the chosen sequences to arduino. I was thinking about storing the data to file like config.txt on SD card which is connected to arduino, but I dont know how to read and change it without pulling it from arduino and plugging it back. I am currently determine button function by changing it in the code it self:
case 'A':
Keyboard.press(KEY_LEFT_CTRL);
Keyboard.write('c');
Keyboard.releaseAll();
break;```
I want to somehow determine it in config and transfer it inside this case. If someone know stuff like this, please contact me. I would really appreciate.
P.S. I am talking about Arduino Leonardo.
It might make sense to store the configuration in the Arduino's flash memory along with the program. If the amount of data is small, you might also be able to store it in the Arduino's EEPROM. Either might be more convenient than an external SD card.
So uhm, are there any libraries with Cstring involved?
I don't see any references to cstring in your code, so I'm still unsure what you're looking for.
What do you mean by store the configuration in the Arduino's flash memory along with the program? Is it possible to tamper somehow with the internal code to keep changes permanently?
Yes, it is. You can either bake in the values using PROGMEM, or have your code write its own values to flash (it could receive them from the host computer if you liked) like the bootloader does (it's a little intricate but possible): https://forum.arduino.cc/index.php?topic=332191.0
I need to look into this, because I am quite new in the Arduino stuff but I want to make something very practical.
@fading zenith It might not be what you're looking for but you should take a look at QMK for inspiration. It's a platform for building easy to use firmware for keyboards https://qmk.fm/
Its not what I am looking for, but the idea is pretty similar. Unfortunately I dont know how to import setting, which were set by a user in interface, permanently. I need to figure out how to place settings inside my set cases.
Hi! New to the discord -- I am trying to make a truth detector using CPX and a bolted on TFT gizmo (https://www.adafruit.com/product/4367) hooked up to a heartbeat sensor (https://www.adafruit.com/product/1093), I have it coded in arduino and plotting the heartbeat in a little chart - but how can I get it to output text and something that says truth or ie based on a range of the heartbeat is in? Code is here: https://forums.adafruit.com/viewtopic.php?f=58&t=168463
@brazen hatch I don't quite follow. Would you just do something like this? (this is fake code of course) bool is_lying = calculate_is_lying(); if(is_lying){ tft.write("Lie"); } else { tft.write("Truth"); }
Hi! Yes that makes sense but I’m struggling to get it to work in the Arduino code I have - any tips 🙂
I'd create a separate sketch just to play around with text. When that feels comfortable you can combine the two together.
It looks like the graphics test here might be helpful -> https://learn.adafruit.com/adafruit-tft-gizmo/arduino-libraries-test
Hi. Does anyone have experience with the ArduinoJson library? I'm having trouble retrieving a parameter from the serialization.
This is what my json looks like
prettified
{
"command":"get"
"result":"ok"
"what":"loc"
"found":1
"entries":[
0:{
"class":"a"
"name":"KD9ICT"
"type":"l"
"time":"1610825646"
"lasttime":"1610825646"
"lat":"42.12967"
"lng":"-87.91083"
"altitude":191
"course":74
"speed":0
"symbol":"/>"
"srccall":"KD9ICT"
"dstcall":"TRPW7X"
"mice_msg":"111"
"path":"qAR,N0LSR-1"
}
]
}```
raw
```{"command":"get","result":"ok","what":"loc","found":1,"entries":[{"class":"a","name":"KD9ICT","type":"l","time":"1610825646","lasttime":"1610825646","lat":"42.12967","lng":"-87.91083","altitude":191,"course":74,"speed":0,"symbol":"\/>","srccall":"KD9ICT","dstcall":"TRPW7X","mice_msg":"111","path":"qAR,N0LSR-1"}]}```
I want to get "lat" and "lng" out. But I can't figure out how
I can find examples for pretty much every other situation, but not this one
I can get "command" or "result" out with a statement like
const char* result = doc["result"];
where doc is the name of the StaticJsonDocument
but for data within that array (entries), I'm a lost cause :[ any tips?
Hey I just have a simple project I want to do. A rc car with a camera that you can control through bluetooth. I have an arduino uno so if I can use that it would be great thanks for the help.
I do not recommend the uno, but it should be usable, note if you connect a bluetooth peripheral, the micro in the bluetooth modem is more powerful than the uno
what do you recommend then
I recommend instead of getting a external bluetooth peripheral is to buy a nrf52 based board, which has bluetooth built in, and can be used with the arduino the same way as the uno.
I'm new to electronics
For the camera, you have very limited options, but as long as you set your expectations right an ArduCAM will work
alright thanks
do you know of any good tutorials using both?
the nrf52 and arducam
There are many if you do a google search, not together but luckily arduino makes it so the software for the camera on other devices will work just fine if you copy and paste it into your nrf52 sketch
how would I be able to control and see live footage from my phone
would I need to download an app
You would need to either use an existing app, and implement what that expects on the nrf52 which I am unsure about, or make your own app.
I dont know of an app you could use out of the box
Technically speaking, you can use GATT for control, and L2CAP for the video stream and that will work well
what is gatt or l2cap
So bluetooth is a series of standards, both of those are bluetooth standards. L2CAP is the transport layer so kinda like TCP on your computer which is on top of the bluetooth radio, then gatt is another standard on top of l2cap that lets you get/set values in a service. For isntance if you have a heart rate sensor, typically it will expose a heartrate GATT service which an app can get the value from
I'm sorry but I don't understand any of this. I wish they would teach us this in school
You're good, any specific question?
I just read the bluetooth specs, they are available online. But some googling brings many resources https://www.rfwireless-world.com/Tutorials/Bluetooth_tutorial.html
And I would use the arduino framework if I were you, which is c++
and also if this is going way above your head you should make something simpler first. like a line follower using just a strip of sensors that read light/dark (reflected light intensity) underneath you. there should be plenty of youtube/inventables tutorials. anyway do things in lots of small steps and you have a better chance of success. line follower -> add human control but with a simple device like a potentiometer attached to a long control wire straight to the car -> human control over wifi/bluetooth (must find tutorial to follow) -> add video stream... something like that.
@woeful steppe If you're new to electronics, you might want to start with some simple projects first. Bluetooth + live streaming video + controlling an rc car might be a bit much for a first project
(ah I hadn't scrolled down in chat. Basically what Moinate said)
sorry for bumping but does anyone have any experience at all? I've been trying to solve this same issue all day and am getting really nervous
@floral coral I'm not familiar with that specific library, in javascript I'd do something like result = doc["result"]["lat"]
Why [result]?
Oh sorry I was part using your example part not paying attention lol one sec
how about doc["entries"][0]["lat"]
This doesn't work unfortunately, even though it seems like it would 😬
What's the error?
It just doesn't see any data there
How are you getting the data? Are you sure the data is there?
I'm sure the data is there because I can do doc["command"] and get "get" from ArduinoJson
so something about specifying within that array is wrong and not really described anywhere in the documentation
@floral coral have you tried using the assistant?
Isn't that just for specifying the size of the JsonDoc?
It also tells you how to serialize/deserialize
Okay, I'll check it out again.
I threw your JSON in it and got whats in the screenshot. The link I gave then deleted was right just focused on memory use not sub documents
Then for every element in your array, you can parse the documents one at a time which is nice memory wise
IT WORKED. OH MY GOD
thank you guys 😭 I can't believe I was missing something so obvious
cheers
Not the first to have the issue, should have seen arduinojson in the early days 🙄
At this point I have shunned json in embedded devices
Hah, while chatting with you I was thinking back (not fondly) to the days of being so confused by one of my circuits. I spent 6 hours debugging, went to a meetup to get help and had it fixed in literally 10 seconds. It happens to all of us!
alright I probably will try a simpler project
What do you use in its place? Please don't say "XML"
it's cause I saw the mini tank project on yt that had the live stream video and control but the parts are out of stock
and I am going to get a 3d printer
and I wanted to kinda make like the drone in rainbow six
Protobuffers are pretty awesome
And since I work with a lot of other developers working on high level applications, the proto file workflow is amazing
Makes sense, and sounds reasonable
JSON is optimized for humans not for what actually uses them, which can be nice, and doesnt have much overhead in JS, but that is kinda a niche in computing outside the browser
Well, Im not really explaining this to you, you are probably fully aware
But for those lurking
Ive been wanting to really dig into Capt'n proto, which is similar but also has a really neat rpc method i think can save battery on my devices on top of being slightly faster
Bencoding is nice
Do you have an example use case outside of bittorrent?
Oh okay, it is general purpose, neato
Hardware question about the CPX. The 3.3v voltage regulator's EN is also connected to IN. Does this mean I can short VCC to ground to disable the regulator as a power switch, or is this basically shorting my power supply/battery and asking for trouble?
(schematic: https://cdn-learn.adafruit.com/assets/assets/000/049/671/original/makecode_schem.png?1514316401)
Option 2
Pray to god the protection circuit in your battery works
Some adafruit products have a pin to disable the regulator and a pullup
Are you wanting to turn it on or off from a battery? If so, they do have have a JST switch which will just cut power to the device https://www.adafruit.com/product/3064 or alternatively https://www.adafruit.com/product/1863
By popular request - we now have a way you can turn on-and-off Lithium Polymer batteries without unplugging them.This PH2 Female/Male JST 2-pin Extension Cable comes with an ...
If from micro USB, they have those too https://www.adafruit.com/product/2379
I'm looking to add a power switch. I'm familiar with the "EN" pin of the feather bluefruit. Worked really well, and was hoping this could work similarly. Sounds like no. Thanks!
Hello, yalls. I'm working with a BNO055 IMU and we're trying to get it to tell us what its current mode is so that we can confirm the configuration changes that we made were done correctly. We found in the library for it a read8 function but it is private. Do any of you have insights on how we can get the board to tell us what mode it is in to confirm we change it right?
you could PR a new getMode function?
What do you mean by PR?
Probably write?
Like you are saying we could write a getMode function that reads the register?
OH I see what you mean, we're looking through the Adafruit_BNO055 library when we should probably be looking through the Wire.h Library.
@dark shard PR = pull request. It's the general process for submitting changes you've made to an open source repo, like the BNO055 library. If you are unfamiliar with that process, you could open an issue:
https://github.com/adafruit/Adafruit_BNO055/issues
as a way to request new features.
Okay, thank you.
if you want a quick hack you could use today, just edit your local copy of Adafruit_BNO055.h and make read8 public
you could just comment out the private: line:
https://github.com/adafruit/Adafruit_BNO055/blob/1c06d4fa6584e7cc688e3f2a496b1385769bc13a/Adafruit_BNO055.h#L317
We were thinking of that but we couldn't find it whic was disappointing.
should be in your libraries folder
That is what I figured but it isn't there. 😦
typically that's <Sketchbook location>/libraries
are there any subfolder there at all?
You are referring to in the Arduino IDE? Sketchbook doesn't have any tabs in it. Hmm that is weird.
yep. you can check your Sketchbook folder location under Files->Preferences
I found the library!
cool!
So it has private: before the read8, readlen, and write8 functions. I'm relatively new to this, do you think just commenting out the private: part will work or do I have to specify it as public:
you should be able to just comment out the private: line
then it'd be like everything is falling under public:
Okay, thank you kindly, I will try that.
How would we read it? As just a
Serial.println(Adafruit_BNO055::OPR_MODE);
call read8 on your instance
for example, if you created your bno with something like:
Adafruit_BNO055 bno = Adafruit_BNO055(55, 0x28);
then use:
Serial.println(bno.read8(0x3D));
I think that is working. Thank you very much.
sure. np! happy hacking 🙂
Errr maybe not.
Okay, so I have what you put for creating the BNO and when I try the BNO.read8(0x3D)); it says that it is initializing argument 1 of 'byte Adafruit_BNO055::read8(Adafruit_BNO055::adafruit_bno055_reg_t)'
It looked like it worked because it gave me what I was trying to set it to 12 which is 0x0C but when I tried setting a different mode it still reads as 12.
how would I wire up two sensors that both need 5V to an arduino mega
would it work if I just attached another cable on the breadboard going from a common 5V source?
Yes, that should be fine
Is anyone familiar with writing Arduino board definitions?
Not all that familiar, but I did it once.
mostly by copypasting existing definitions, and then changing what needed to be changed.
Same here, but in Energia (an Arduino port for MSP430 chips)
Hmm
I have been working with the Adafruit MagTag under Arduino-esp32. This has worked pretty well up until I refreshed the espressif/arduino-esp32 idf-release/v4.2 branch recently. As of this last release the USB serial port no longer successfully identifies. I have validated that on the previous commit this still works. I have created an issue for this (https://github.com/espressif/arduino-esp32/issues/4728). Has anyone else encountered this problem?
I'm a beginner and I have an overly-cautious question about powering an Arduino via a 12VDC 1.0 Amp wall adapter and the Arduino's VIN & GND pins. The documentation for the Arduino says that it can handle being powered by 12V, but in the examples they always show the 12V coming through the barrel jack. Can it handle 12V coming in from the VIN & GND pins on the Arduino? I tried asking in the Arduino forums but nobody answered. The purpose of all of this is to have a high-powered LED (via a Sparkfun PicoBuck) light up whenever I want it to, and not fry the Arduino unnecessarily.
The barrel jack is hooked to the VIN pin via a diode: it should be fine to power the board by the VIN pin, but it doesn't have polarity protection, so be careful not to hook it up backwards.
Also done be alarmed if the regulator is hot
12V-5V will dissipate a little bit of power 🙂
What's the difference between these two ATmega328 boards on Adafruit's website. One has 20 GPIO advertised while the other has 19 and that seems like a typo <@&669538345994682378>
Thank you!
Looks like a typo. The later "detailed specifications" list 20 pins for both: 20 Digital I/O Pins: 6 are also PWM outputs and 6 are also Analog Inputs
Should be no difference between the two boards as far as functionality/design, as far as I can see.
That's what I figured as well. Double-listing, I guess. Probably for historic reasons. Idk.
No, one board comes fully assembled, while the other requires assembly (soldering headers)
They both say "fully assembled." PID: 2488 says "fully assembled" in the description and PID: 50 says "fully assembled" in the product title.
That's weird. I thought all the products that say "with headers" were loose headers
🤷🏽♂️ maybe one of the Adafruit folks will reply tomorrow.
How to solve this whenever I tried to connect nodemcu it shows this error
I had download driver
Also I download library
And Arduino ide didn't detect it
guys, question, does anyone know about ROS with an arduino?
are subscribers in arduino only toggleable?
im currently using this code, basically im trying to sub the arduino to my computer to try to listen to specific values. When these specific values are met, the led will toggle on, if not, the led will turn off
how can i specify the subscriber to listen for specific cues?
@leaden light Do you know which serial chip your board has? Can you get a listing of the vendor ID and product ID of the unknown chip?
😅ty for helping my problem was solved after watching 2hour yt videos .
Problem is on usb cable after changing it nodemcu works👍🏻@north stream
I am beginner
I don't know more about it only know esp8266 😅
If you've got it fixed, that doesn't matter, good job figuring it out.
Can someone recommend MQTT arduino library that supports TLS?
My understanding is that ROS is Linux-based, so it wouldn't run on an Arduino.
@calm parcel Adafruit MQTT Library
alt. the MQTT library by knowlellary(? spelling might be wrong)
I’ve got a bit of an odd question. Does anyone know where I can get a Mega without any headers on it?
Would something like the Metro Grand Central work?
https://www.adafruit.com/product/4084
Possibly. Any idea how similar it is to the Mega, as I’d like to avoid having to rewrite my code if possible?
I'm looking at the product guide to see
https://learn.adafruit.com/adafruit-grand-central
It does mention that it has the mega shape and pinout
If you go to the "Pinouts" page of the guide, it has all the details
Hmm. It definitely looks like it has potential. Thanks!
That's great! Good luck to you on your project! Come back and show it off if you can, and if you have questions, you know where we are 🙂
Will do!
@queen sigil Would this work? https://www.amazon.com/ATmega2560-16AU-Development-Without-Unsolder-Header/dp/B07GBV6GN9
Hello! I tried connecting my 128x32 OLED to my new nRF52 Feather, however the buttons are not working. I'm using the example code 😦
Hello, Can someone explain me what this bit of code does? I'm new to using interrupts
TCCR0A = 0; //clear timer0 register (TCCR0A)
TCCR0A |= (1 << WGM01); //set the CTC mode for timer0 with OCRA as top
TCCR0B = 0; //clear timer0 register (TCCR0B)
TCCR0B |= (1 << CS00) | (1 << CS02); //set prescaler of timer0 to 1024
TIMSK |= (1 << OCIE0B); //activate timer compare match interrupt for OCR0A and OCR0B
TCCR0A = 0; //clear timer0 register (TCCR0A)
TCCR0A |= (1 << WGM01); //set the CTC mode for timer0 with OCRA as top
TCCR0B = 0; //clear timer0 register (TCCR0B)
TCCR0B |= (1 << CS00) | (1 << CS02); //set prescaler of timer0 to 1024
TIMSK |= (1 << OCIE0B); //activate timer compare match interrupt for OCR0A and OCR0B
Ah! thank you. I didn't know how to do that.
You're setting the control registers for timer0. Looks like some kind of PWM scheme, my AVR skills are quite rusty.
Could be waveform generation mode 1 (WGM01), the timer runs at the base frequency/1024, and you get two interrupts per cycle. OCR0A would control the PWM frequency and OCR0B sets the duty cycle.
Maybe your interrupt code would toggle a pin on each invocation, so you get to pick the pin doing the PWM. I think some pins can be directly connected to the timer, in which case you wouldn't need an interrupt.
Yeah that definitely would, but I have concerns about the authenticity, and thus quality, of that board. It looks like a third party version.
I've had lots of success with third party boards. But fair enough. Adapting code for a first party board could be better
what resistor value would i need for a white LED?
Adafruit's white LEDs are spec'd as "3.0-3.4V Forward Voltage, at 20mA current"
Hi, I bought a bunch of Adalogger featherwings and feather M0 LORA boards and I'm not able to get the SD card reader to work on any of them. I can get the RTC to work, but the CardInfo sketch constantly returns "initialization failed.". I have set chipSelect to 10 and confirmed that the SD card has clicked in. I have formatted the SD card with the official SD card software linked on adafruit and confirmed it works with an older WickedDevice Arduino with SD card reader. I have continuity tested every single pin between the feather and the shield. I have tried a different arduino with a different shield on it (I bought 6 of each). I have done a clean install of the Arduino studio with freshly loaded libraries on a separate computer. NOTHING WORKS. I'm at my wits end here. Is the M0 Lora just not compatible with the SD card logger or something (maybe LORA uses the SPI pins as well and creates a conflict)? Any suggestions on how to make this work would be appreciated.
Trying to controll brightness of LED's with a potentiometer but the values are something stuttering and it results in the LED's flickering
//===================================================================================================================== //
// INCLUDES
//===================================================================================================================== //
#include <Arduino.h>
#include <FastLED.h>
#define NUM_LEDS 24
#define DATA_PIN 2
CRGB leds[NUM_LEDS];
float smoothADC;
int sensorPin = 0; //pin number to use the ADC
int sensorValue = 0; //initialization of sensor variable, equivalent to EMA Y
float EMA_a = 0.6; //initialization of EMA alpha
int EMA_S = 0; //initialization of EMA S
//===================================================================================================================== //
// SETUP
//===================================================================================================================== //
void setup() {
Serial.begin(115200);
LEDS.addLeds<WS2812,DATA_PIN,RGB>(leds,NUM_LEDS);
LEDS.setBrightness(100);
EMA_S = analogRead(sensorPin);
}
//===================================================================================================================== //
// MAIN LOOP
//===================================================================================================================== //
void loop() {
smoothADC = 0.9 * smoothADC + 0.09 * analogRead(0);
//Serial.println(smoothADC);
int mappedValue = map(smoothADC, 0, 1023, 0, 255);
Serial.println(mappedValue);
fill_solid(leds, 24, CHSV(255, 0, 255));
FastLED.show();
LEDS.setBrightness(mappedValue);
}
what am i doing wrong?
At first glance you keep setting the fill on the loop
Consider changing it so you don't set the fill/value unless it changes
@sterile scaffold see this note https://learn.adafruit.com/adafruit-feather-m0-radio-with-lora-radio-module/pinouts#rfm-slash-semtech-radio-module-2825156-12 for the M0 Lora -- you have to manually set D8 High when you are not using the Radio if you want to access another SPI device.
YESSSSS!!!! This totally works, thank you so much!
Great! Glad it worked!
I was on here a month or so ago with another person trying to help and we just kept banging our heads against the wall, and I've been doing that on my own as well. I think I was close there thinking that the LORA chip might be conflicting with the SD card, but I never caught the PIN 8 note
thanks so much
How do I set a color for my whole Adafruit NeoPixel 5m strip? I mean without a fading or Wipe effect?
.fill()? (IDK if that's a function, but I think it is) I haven't touched Neopixels in a while...
I am doing a project with an arduino uno but I don't know how to code it. so I want the code to do this:I want it so that when the temperature is below a certain number for example 60 the lights will start at a light blue and as it gets colder the lights turn into a darker blue. And the same thing for how hot it is just with red not blue.
I'm using a thermister for the sencors and LED strip lights for the lights
I have my circit set up like this right now
Arduino MOSFET Circuit
I don't see where the thermistor is hooked up, but basically, you'd configure it as a voltage divider with a resistor, and hook the junction to one of the analog inputs. Then you can use analogRead() to read the value from the thermistor, then use math to figure out the various brightnesses for the LEDs, and write those values out to the LED control pins with analogWrite().
I've been stuck on trying to get DMX working on a semi DIY board with a MAX485 chip for a couple weeks. I know the output device for DMX is working since I can control lights, and I've looked at the signal via an oscilloscope and compared it with the input and it matches (just with 0-5v instead). My custom board is based on and designed around this one http://www.mathertel.de/Arduino/DMXShield.aspx . I'm using it solely to receive DMX for now using the DMXSerial library.
Hello! I tried connecting my 128x32 OLED to my new nRF52 Feather, however the buttons are not working. I'm using the example code 😦
I can't get blynk cloud ip from my command prompt for webhook it gives me alphabetical ip. How to get exact ip??
For node mcu automation
@spiral knot can you post the link to the example code you are using? there many examples...
who wants help
did you get it working?
i went in another direction 🙂
Hey ya'll I'm trying to work with https://learn.adafruit.com/how-to-fuse-motion-sensor-data-into-ahrs-orientation-euler-quaternions/overview, but when I attempt to run the calibrated_orientation sketch I am getting two errors:
-'SENSORS_RADS_TO_DPS' was not declared in this scope; did you mean 'SENSORS_DPS_TO_RADS'
-'class Adafruit_Sensor' has no member named 'printSensorDetails'
Looking at https://github.com/adafruit/Adafruit_Sensor/blob/master/Adafruit_Sensor.h it appears the Github version differs from the version I pulled down through the Arduino IDE. If I update my Adafruit_Sensor.h file with the version in Github the errors clear. I am working with Adafruit Sensor Calibration version 1.1.2 in the IDE. Is the Github code the most current?
I have a new Datalogger Shield with the 8523 RTC, which I can't get to work, when I run the example from the RTClib I get the following - "Couldn't find RTC" I put a fresh battery in, and waited before loading the file "pcf8523" from the examples folder. The SD card part works great, but the RTC nothing..
Disregard - I found this forum post: https://forums.adafruit.com/viewtopic.php?f=19&t=173590&p=846285&hilit=printSensorDetails#p846285
Cleared Arduino lib folder and redownloaded libraries and now all is well
Hello, complete Adruino noob here. Bought an Adafruit Metro and a couple Adalight project packs and having some strange issues with the lights.
I followed the tutorial at https://learn.adafruit.com/adalight-diy-ambient-tv-lighting/overview
to get everything hooked up, and had some with mismatch errors when initially uploading the LEDStream sketchbook they provided. After a few tries I got it to upload and Colorswirl works but the lights are pretty flickery (2 25 strands of the WS801 they provide with the kit), and the Adalight code does nothing.
When running PSIEG's fork of Prismatik the lights start up and behave somewhat like they are supposed to, but not really; some are off color and when I change to mood lighting and try to select a static color, it changes on most, some flicker a bit, some a few wrong colors....
When I connect just the 5v DC to the lights (no Metro) the lights light up erratically. Sometimes different colors, sometimes a few flicker, etc.
Oh, also if I wave my hand over the end lights, depending on the configuration, the lights will shut off or change colors. 🤷♀️
I've tried flashing FastLED to the Metro, but I can't flash anything again as I just get more mismatch errors...
Can somebody with some experience in all this please lend me a hand? I'm really at a loss as I've spent the last couple days looking up everything I can on Reddit, Adafruit forums, etc and I just can't figure this out...
Oops, sorry when I said 'flashing' I meant uploading from Arduino IDE to the Metro
Hello, can anyone help or point me in the right direction if not?
@supple sail Can you share photos of your circuit
And what does your code look like?
Also do you have a better photo of how the wiring is setup from the MEtro to the lights?
IT's kind of hard to tell what the red, green, and blue wires are connected to
LEDStream
Did you modify anything in there or is that straight from the example?
nothing changed. The wiring from lights to metro goes:
Blue to GND
Green to 13
Yellow to 11
Though I have a 4pin connector between them that has different colors, to make it easier to connect.
thank you for helping btw
I cannot upload any code to the metro it seems. The PC I am using is full of USB 3.0 and '3.1'. Should I try another PC?
are you using the arduino IDE?
Yes.
YOu should be able to unplug the microcontroller, plug it back in and check that the correct port is selected under tools
sometimes these devices are a bit finicky
also changing to a different usb port helps sometimes
Yes, I have double checked the COM, it is set right; have also tried a few different ports/USB cables.
I forgot a detail. When first connecting the Metro to PC with USB, it did say it was installing a driver, however as on the Metro info somewhere it said I would need to install a 2014 driver... So I followed some links that were now defunct, and installed the CP210x_VCP drivers. Then when that didnt' seem to work right I installed the adafruit/Adafruit_Windows_Drivers from Github (without uninstalling the previous ones).
Now, if I uninstall the Metro COM driver from device manager, the Metro doesn't automatically detect one when plugged in and I have to install again.
I'd disconnect everything and try and figure out how to get a basic sketch working first.
I'm not familiar with Metro so I can't help with those specifics. But getting back to a basic setup should make debugging easier
I got it to upload once, and I can run Colorswirl sketch with no issue, but the lights are flickery.
Is the behaviour described in my OP from the lights when not connected to the Arduino expected?
Metro is described as being the same as the UNO
@thick stag Hello again. So I broke everything down, removed all drivers that were installed and started fresh.
I can run blink and it works, but I still get verification errors.
avrdude: verification error, first mismatch at byte 0x003f
0x80 != 0x00
avrdude: verification error; content mismatch
avrdude: verification error; content mismatch
You'll probably want to copy those specific errors into Google and read the arduino forums
(I wouldn't know without doing the same)
All good, I have been searching everything I come across so no shortage of that here.
I appreciate that you took the time to make some suggestions though.
If I didn't want to tinker, I wouldn't!! 😄
Hah glad to help
There's always a balance between getting immediate feedback and bouncing around google 😄
Always good to exercise the google muscle
Hello everyone, i have a question. Im using an atmega328p to read from an mpu6050 via i2c. Iam also using a timer that keeps time in milliseconds. Im using timer2 with 16MHz crystal and a presalacar of 64. Every 1024us (1.24ms) an interrupt occurs and a variable is increment by 1 to count milliseconds. My concern is, wouldnt the interrupts affect the i2c communication?
Like many questions, it depends. For one, the ATmega has hardware support for I2C, so it doesn't have to depend on the CPU. For another, I2C is synchronous, so the CPU controls the timing. However, some implementations don't use the I2C hardware and do depend on the CPU for timing. Additionally, some I2C sequences use tricks like "clock stretching" that make it more complicated and subtle. So the short answer is ... "maybe".
I've got a circuitplayground express that I'm using the Arduino LowPower library with. Does anyone know what happens to the Neopixels if I tell the MCU to sleep or deepsleep?
Not sure if the neopixels have their own processor or something
They do, but they only change state when sent data. As long as the sleeping MPU doesn't send them something confusing, I would expect them to continue displaying whatever they were last sent.
Hmm somewhat related problem: I can't get the CPX button A to trigger an interrupt to wake from deepsleep. I register both CPLAY_LEFTBUTTON and CPLAY_RIGHTBUTTON, but only button B triggers the interrupt. Button A does nothing.
I'm using pin 4 and pin 5. Is that correct?
Or should I be passing it interrupt IDs or something?
The function is (Arduino)LowPower::attachInterruptWakeup
Okay I dug out the offending code in the arduino library I think...
in framework-arduino-samd-adafruit/variants/circuitplay/variant.cpp, button B (pin 5) is listed as EXTERNAL_INT_14 while button A (pin 4) is listed as EXTERNAL_INT_NONE.
This fails the check in ArduinoLowPower.cpp on line 97 (in == NOT_AN_INTERRUPT) so it just refuses to register the pin as an interrupt.
I don't know who's at fault. Is the variants.cpp definition correct? Is ArduinoLowPower reading that value incorrectly? Are they both using the same field to mean different things?
Okay I think I understand the file a bit more. I've created a PR at https://github.com/adafruit/ArduinoCore-samd/pull/281 which should fix it. The commit message is really ugly though. I got it mixed up with the PR message.
I think this file doesn't match the circuit diagram listing at https://cdn-learn.adafruit.com/assets/assets/000/047/156/original/circuit_playground_Adafruit_Circuit_Playground_Express_Pinou...
Im using https://www.adafruit.com/product/1743 in a project, but i dont need 16bit colors, is there a way to send less bits maybe even 1bit data/pixel to speed up date transfer?
Need assistance: purchased ""1.44inch LCD Display HAT 128x128 Pixel SPI Interface Direct-pluggable onto Raspberry Series Boards Examples for Raspberry Pi/Arduino/STM32 Driver ST7735S"" from Amazon based on the indicated 'examples for Arduino' in the item's title. sadly, was bought more than 2 months prior to a project build, so no returns based on the seller's error. question: is there ANY way to make this HAT work with an Arduino Nano, including the buttons? was referred to this discord in the Q&A section of reviews for possible help getting this off the ground...
do you have a pinout of the device?
But I can't think of any reason why it wouldn't just work on a development board rather than a Pi.
sec, i have the manual, which has the pinouts...
@rancid zinc - I'd doubt it. But... that display has a full internal buffer, so unlike many others, you shouldn't be needing to send the whole display on each refresh, just redrawing what you need.
@obtuse spruce or not, apparently....
Thanks, i read from the driver datasheet that theres a 8 color mode, not exposed in the adafruit lib i think i might be worth checking out i guess
@restive gazelle - without the pinnout, it'd be hard to know... BUT - it would seem likely that the device just needs SPI, and 8 or so GPIO likes for the buttons and joysitck. This should interface to a nano (assuming you have enough free GPIO, which depends on which nano model and what else you are doing.)
I general, I don't buy devices like this off Amazon, even if they are 1/2 the cost - because the effort that Adafruit and Sparkfun and similar places make to have the technical documentation available and clear is more than worth the extra $.
Without the pinnout, you can only guess...
Mind you, you could probably probe it with a multimeter and discover where all the switches are
@ mzer0 found a pinout on the waveshare page
@obtuse spruce sigh. typing skills are lacking without more coffee...
SYMBOL RASPBERRY PI PIN (BCM) DESCRIPTION
KEY1 P21 Button 1/GPIO
KEY2 P20 Button 2/GPIO
KEY3 P16 Button 3/GPIO
Joystick Up P6 Joystick Up
Joystick Down P19 Joystick Down
Joystick Left P5 Joystick Left
Joystick Right P26 Joystick Right
Joystick Press P13 Joystick Press
SCLK P11/SCLK SPI clock input
MOSI P10/MOSI SPI data input
DC P25 Data/Command selection (high for data, low for command)
CS P8/CE0 Chip selection, low active
RST P27 Reset, low active
BL P24 Backlight
Yo what's up y'all
I recently bought an Arduino board and I'm wondering if any of y'all got good starting pointers for it
okay - so, sure - that should hook up to a nano... you'll just need a lot of jumper wires!
@restive gazelle which model nano do you have?
@dark gust - what sort of things are you interested in doing? did you get any other things to go with the board you got, like light strips, or leds and a breadboard, motors? etc?
Well I bought the official Arduino Starter Kit but I really didn't know what else to buy with it cause you know how it is with Amazon, they try to make you buy things with it and sometimes they don't even make sense. Although, what I am trying to do with the Arduino is use it as a way to get into the rabbit hole of electronics like hooking it up to other components or electronics and make it do things
But currently what I want to do with the Arduino is get a good solid guide to learning it before I try to do anything complicated with it. Although I am really trying to get into electronics, circuitry so I can do some pretty interesting things with it later on the road
I know some wiring basics since I used to work as a electrician but I know the Arduino is a different beast cause you have to code and such
Dope, so the starter kit itself is what I need to learn the basics before anything right?
I shouldn't buy anything currently?
Yup that's it
It it's that kit (or very similar) - then you've got plenty to keep you going for a while and learn the basics
The one you linked is spot-on that one
I didn't wanna buy any clones so I went for the official one
Okay - that also has a project book, and those'll be directly applicable
@obtuse spruce VID: 1A86 PID: 7523
So would you suggest I start with the link you provided and then the book? Cause I want to learn it in a ABC order rather than hopping to different topics if that makes sense
Cause I usually get tangled up when it comes to learning programming and such since you can start to focus on one area too much
@obtuse spruce ELEGOO Nano Board CH340/ATmega328P
@restive gazelle - I have no idea how to translate that USB id into a model! Nano 33 BLE? Nano Every? Original Nano? See: https://store.arduino.cc/usa/new-home/nano-family
@dark gust - I don't know the book, so can't say, but assume that it is designed to go start to finish in a clear order. The Lady Ada page is a good start from zero "what is all this" - but then it let's you jump off as your desire goes.... I'd start with the book
@restive gazelle found it - okay - so same pinout as the original Nano - https://content.arduino.cc/assets/Pinout-NANO_latest.pdf
So, sure - you've got enough pins and SPI on the Nano - just, er, hook it up!
Ahhhh so as you start learning the basics you start to get an idea of where you want to go and by then, you should already have a clue or idea of where you should go by there
@obtuse spruce yes!
Sounds pretty set, thank you for the help mzero, have a good one
@obtuse spruce now just need to know what the equivalent pinouts are between Pi and theNano (or for that matter an Uno R3, since i can cross between Nano & Uno)
Don't approach it like that... Instead, look at the pinout of the display and see where on the nano pinout they correspond to
You can forget about the Pi pinout here
@obtuse spruce ... point well-made, and taken, sir!
Anyone have any experience coding MIDI controllers?
yes
and there are probably more over in #help-with-audio (which isn't strictly audio!)
So basically I want read the output from the serial monitor into my python program. But when I run both the arduino program and the python program (using com5) it says access denied. Can both programns not use the same com??? Here is my python code (from a website) ``` import serial
import time
set up the serial line
ser = serial.Serial('COM5', 9600)
time.sleep(2)
Read and record the data
data =[] # empty list to store the data
for i in range(50):
b = ser.readline() # read a byte string
string_n = b.decode() # decode byte string into Unicode
string = string_n.rstrip() # remove \n and \r
flt = float(string) # convert string to float
print(flt)
data.append(flt) # add to the end of data list
time.sleep(0.1) # wait (sleep) 0.1 seconds
ser.close()
for line in data:
print(line)```
and the arduino program just prints to the serial monitor
How does one read the serial output from the arduino and put it into the python
You cannot have two programs access a serial port at the the same time
Closing the serial monitor should free it, allowing Python to take it
or run the terminal program for one or the other on a different com port
I usually connect two targets, TX to RX each way and do everything on the local serial (the one setup by:
Serial1.begin(9600);
in the Arduino IDE world.
(Serial, not Serial1, is the USB port)
I've been having a lot of problems getting Arduino to upload a test program to a ESP32 Feather in Ubuntu Linux
Traceback (most recent call last):
File "/home/jim/.arduino15/packages/esp32/tools/esptool_py/3.0.0/esptool.py", line 38, in <module>
import serial
ImportError: No module named serial
I only get this error when I'm using an ESP32 or ESP32S2
@deft oak does this help? https://github.com/espressif/esptool/issues/528
@reef ravine I'll study that some more, but I tried to install something else not Arduino related the other day and it would not work with that package to force Python3 for python
@reef ravine Thanks, 2 parts to the solution. python-is-python3 and apt-mark-hold a bunch of 2.7 packages
I think virtualbox was the package that hates python-is-python3
Good day all. I am building a Steam Punk clock that will be driven buy a NEMA 17 stepper motor. I'm a mechanical guy, not electrical or a programmer in any way! Here is my dilemma. I was able to get it running and turning at the needed 60 RPM using an Arduino Nano and a little DRV8833 driver bd. It works but is very noisy!! I'd like to be able to make it run quieter. I think that it can be done, because I guy at work showed me my motor running off of something he had. So you ask, why can't he help? I can only say that he is extremely busy, and I don't think he wants to be bothered. So, is this even the place to ask? I would love to be able to work with someone. I would be willing it compensate that person. I'm in the Syracuse NY area. I can be reached: 3261ford@gmail.com
Additionally, I'm not familiar with this format. So, if I'm not doing this right, I mean no disrespect. Thanks, Sid
@barren mango have you tried adjusting the trim pot on the driver (a little at a time) to see if more (or less) current limiting helps? no problem but a question like this is probably better suited to #help-with-projects
There is no trim pot on the driver bd.
Hi folks, I don't know much about coding/arduino. However, I followed a tutorial to create a button box using an arduino leonardo.
All is well and good except that my rotary encoders seem to only register once for every 2 "clicks" in either direction.
The buttonbox code is from this video: https://www.youtube.com/watch?v=wkY1NsbWj5I
IMPORTANT: I mistakenly said you can use Arduino Uno for making a button box. That is INCORRECT Uno will NOT work with this guide. You can only use Arduino Leonardo or Pro Micro.
How to design, build and code your very own button box using arduino! Perfect for flight sims, racing sims or space sims.
This video covers how to build a box using ...
And this is the datasheet for the rotary encoder.
I have no idea if it's just a factor of the resolution of the encoder? or something in the code I need to adjust.
Hey folks, anyone know why my LCD won't dim when I wire my VO pin to a potentiometer?
What kind of LCD, something from the Adafruit shop? How are you connecting the pot?
Note that the VO line is the LCD contrast adjustment, so it won't control the backlight brightness, if that's what you were expecting.
Oh alright. But even then, it doesn't adjust the contrast
Here's what i'm going off of
I'm trying to use Arduino IDE on Ubuntu with ESP32-S2 Metro, which I know is in early development, but I can't even upload the Blink sketch. I have installed the board package per the method on the learn.adafruit.com site, but I get an error on upload. I had this work about a month ago, but I've re-installed Arduino since then. The error is OSError 71 protocol error. BTW, I can use Windows 10 Arduino with ESP32-S2 and upload the code, but I can't connect to the Serial console after I reset the board. Windows says no Comm port... EDIT: the only solution I found was to blow away my hard drive and reinstall Linux. that worked. but took a few hours
copy from console log
Is there any success traversing a VPN over Ethernet with Arduino ? If so, what is the best target and shield for this ?
As in, you want one end point of the VPN to be on the Arduino? Do you want an encrypted VPN, or is this just IP within IP?
https://www.circuito.io/app?components=513,12787,360217 what is this magical pin 0.... it is not labeled on my esp32 devkit 😐
Learn how to wire the RGB and Gesture Sensor to ESP32 - DevKitC in a few simple steps. The primary components for this circuit are: ESP32 - DevKitC and APDS-9960. Drag and drop these components onto the canvas, and instantly get a list of secondary parts, wiring instructions and a test code for your circuit. Try it for free.
@obtuse spruce IP within IP. No encryption necessary.
@elder hare It could be labeled BOOT or similar, or could just be a button. You should be able to use a different pin and adjust the code. You generally don't want any signals going in to GPIO0 at boot time, it affects whether it starts up normally or goes into the bootloader https://github.com/espressif/esptool/wiki/ESP32-Boot-Mode-Selection
Well that shouldn't be too hard on any development board that already has internet connectivity - IP in IP w/o encryption is pretty easy... though I doubt there is a library for it. The harder part is probably going to be getting some higher level library (like HTTP client) to use the IP-in-IP code.
Hello, is it possible to have a 3V microcontroller board send data one-way over TTL serial to a 5V board? Specifically, a Circuit Playground Bluefruit to an Arduino Uno?
Does the Arduino recognize 3V input as a HIGH signal? Do I need to do anything special with the wiring to avoid frying the Circuit Playground?
Second, can I use both the Arduino IDE serial monitor over usb with the Arduino at the same time as the Circuit Playground?
Will it cause problems during programming over usb?
If there's a better way to get a Circuit Playground Bluefruit and an Arduino Uno to communicate, please let me know.
@hollow helm Microchip 3v Tips n Tricks
http://ww1.microchip.com/downloads/en/DeviceDoc/chapter 8.pdf
Thank you, but this doesn't answer my question. That pdf provides Table 4-1, but I don't know the correct values for the Arduino and Playground.
Second, I don't know which of those tips to do. It talks about the "switching speed of the input", the current consumption, noise, etc, but I don't know what these values are for serial.
An Arduino Uno will recognize 3v as a high signal, so data the to Arduino will be fine. You will need to step the voltage down if you are transmitting from the Arduino to the Bluefruit
You will see whatever happens to be on the TX/RX lines, so you will see what your Bluefruit sends to the Arduino in the serial monitor
Maybe - disconnect the Bluefruit from the Arduino during upload if you experience problems.
Thank you. Just to confirm, there is no required circuitry between the Bluefruit TX and the Arduino RX pins, and this won't cause damage?
A 3.3v output will usually be enough for a 5v input (a level shifter may be required) and there is no risk of damage. 5V to 3.3v does risk damage and so a voltage divider or level shifter is required.
Thank you
https://www.adafruit.com/product/4682
Hello, can I check if I could mount this onto my Adafruit nRF52 that already has a 128x32 OLED(https://www.adafruit.com/product/2900) ?
@spiral knot Yes, the OLED uses I2C, and the SD uses either SPI or SDIO. It's just a question of how you have it physically set up to access the needed pins. On a breadboard, no problem.
Keyboard.h:25:17: fatal error: HID.h: No such file or directory #include "HID.h"
i can't find that HID library :S
It's usually part of the hardware/CPU/board package.
What board are you using?
Hi, i want to connect this display with NodeMCU, and im using adafruit ili9341 library
Can anybody tell me the which pin goes to which?
I don't need the touch functionality
@pine bramble probs want s1,sc,sd and sk? just SPI....
see if this helps?
https://www.electronicwings.com/nodemcu/nodemcu-spi-with-arduino-ide
If anybody can give me the connections specific to this that would be great
i literally just did? 🧐 no?
thats using the other spi port... same idea tho
Yup, thanks
would this -> https://github.com/PhilKes/RGB_Audio_Backlight/blob/master/RGB_Backlight_MSGEQ7/RGB_Backlight_MSGEQ7.ino
work with my -> https://www.digikey.com/en/products/detail/sparkfun-electronics/DEV-13116/5764478?s=N4IgTCBcDaIM4AcCGAnA1gMwK4DsAEiApgMYAuKWAtiALoC%2BQA
running on ESP32?
Arduino Sketch for controlling WS2812 RGB Led Strip + Audio Visualizer - PhilKes/RGB_Audio_Backlight
Order today, ships today. DEV-13116 – MSGEQ7 Signal Level Control Interface Arduino Platform Evaluation Expansion Board from SparkFun Electronics. Pricing and Availability on millions of electronic components from Digi-Key Electronics.
If you are on Big Sur and need a Arduino plugin to upload files to the SPDIFF/LittleFS/FatFS I have a fix:
https://github.com/bergdahl/arduino-esp32fs-plugin
How do I make my Arduino Uno/Nano/Pro micro/ into a low power mode? Is there some built in function?
It turns out there is one that I missed. In case someone else comes looking here is the official documentation. Pro tip: Try to do one thing at one, not two 😅
https://www.arduino.cc/en/Reference/LowPowerDeepSleep
Open-source electronic prototyping platform enabling users to create interactive electronic objects.
would it be 5afe to connect a 10mA rated encoder to an arduino pro micro, or would the power output from either the VCC or the digital pins be too much for the encoder?
and unless im being scammed, that'ss how the rotary encoder looks like
i haven't bought it yet, because of this question
@native kelp it looks like a typical rotary encoder (3 pins one side, 2 on the other)
Digital input pins draw almost no current, if you wire it right almost no current flows through the encoder.
The 10mA rating just means don't pass power through it.
So i can just wire the right pins to VCC and GND and it'll be fine?
And then the other data pins to the digital input
a rotary encoder is wired like a push button, not across Vcc and ground
Oh
But I have to look at two signals to check if its beimg rotated clockwise or counterclockwise
yes
Vcc > 10K > switch > ground
the 10K limits current to 0.5 mA
then A & B are the outputs
But VCC and GND still goes to VCC and GND on the board
yes, but not directly across the encoder, the resistor is in series
Not directly across the encoder?
no, if direct you make short circuits as you spin the encoder
Oh
it's like a switch, never connect across Vcc and ground
in the circuit above, if the switch is open the 10K pulls the pin up to Vcc (HIGH), if the switch is closed it pulls the pin to ground (LOW)
the R's and C's left and right are optional
the 10k's in series with the switches are not optional
Oh right I thougjt the diagram was of the encoder only, I thought it already included all of those
just the switches inside the dashed lines is the encoder
Yep
looks like the one you showed also has a push switch
The specifications didnt necessarily specify, but considering most of the other encoders i found on the store also have buttons, it may have thag too
But some encoders have the resistors built in, the ones that seem to have a whole circuit board on them, right?
if it's sold as a module could be
but be sure to check the datasheet before applying power
Yeah i would if they will provide
For now i either have to find one with resistors built in or source them myslef
it's just two 10K resistors, a very common value, handy to have on hand
good luck with it!
Thanks!
I'm trying to adapt this bit of a code to work on my Gemma M0 instead of an arduino, is it not enough to have changed RECEIVER_PIN 2 to RECEIVER_PIN A0?
#define RECEIVER_PIN A0 // define the IR receiver pin
IRrecv receiver(RECEIVER_PIN); // create a receiver object of the IRrecv class
decode_results results; // create a results object of the decode_results class
void setup() {
Serial.begin(9600); // begin serial communication with a baud rate of 9600
receiver.enableIRIn(); // enable the receiver
receiver.blink13(true); // enable blinking of the built-in LED when an IR signal is received
}
void loop() {
if (receiver.decode()) { // decode the received signal and store it in results
Serial.println(results.value, HEX); // print the values in the Serial Monitor
receiver.resume(); // reset the receiver for the next code
}
}```
Hey homies, would this be the right place to get some help regarding LED's and resistors?
Hello, I'm not sure where to ask for help. So I would just ask here since it involves arduino
I am building a datalogger using DS3231 and sd card breakouts
I'm still not sure how to format the datetime when saving the data
I was reading about ISO8601 format like this 2021-02-01T20:58:23+08:00
Is that the right way to save the datetime?
I would use the log data to plot a graph
It's not even recognized as time in ms excel
@tiny tinsel to be clear, this is an excel question, right?
some experimentation should solve the problem.
just open up a text editor like notepad++ and try some formats until you figure out what excel wants.
or search the internet some https://stackoverflow.com/questions/4896116/parsing-an-iso8601-date-time-including-timezone-in-excel
ancient but the idea seems fine
The problem was that I wasn't sure I was doing the right thing by using that date format.
But thank you for that. I can get the parsing correct now
Of course, you can always use UNIX timestamp (=#of seconds since Jan 1, 1970); this way, it is just a 10-digit unsigned integer, and there plenty of utilities to convert it to any time format you want.
I'm considering doing a Julian Day calculator. ;)
https://en.wikipedia.org/wiki/Julian_day
the Julian day number for the day starting at 12:00 UT (noon) on January 1, 2000, was 2 451 545.
hello, I am writing a C program for a piezzo buzzer. its attached to an 8 bit timer2.
for all intents and purposes I am tone deaf. ive got something in a square PWM wave thats supposed to sound like an a4(it matches the frequency not quite to the decimal) note. but I dont know how an a4 note sounds. are there any sources short of recording all sounds from an arduino sound library?
"A4" is just a frequency. It can sound all different ways depending on the instrument or waveform used. It is only the frequency that makes it "A4". So if you know that what you're outputing is a 440Hz square wave, then that is an A4 note.
@green heath I'm not sure if this is the question, but you could get an app for your phone that will generate the "correct" frequency. Probably. And also tell you what it thinks the note you are producing is. I have one called Cleartune for iOS, it's ancient but all I ever needed.
mmh, I figured I could use my fendertune app but it was quite limited to the guitar notes
Oof. Same principle.
and I cant really tune it other than calculating the right frequency and writing it to the compare match register xD
I have a free android app that will generate a tone at any frequency.
that is more useful information if it comes with a name or a link
Indeed
I wanted to program a sine wave for the buzzer but i just dont get how. You have a 440hz sine wave and you need to get an 8 bit value for one phase?
For each step
Does the Arduino Pro mini 8MHz use a cermamic resonator or a crystal?
Remlly theres lots of information on the internet about producing sound from a buzzer. Maybe you could spell out "the rules of the game" for you? It sounds like you're trying C with interrupts, no external circuitry? Try googling something like "arduino DDS sinewave generator"? Or are you trying to figure this out without somebody else's walkthrough?
I have a book about standalone avr programs
I am coding on a shield
The book only has an include "fullsinewave.h" thats nothing more than an array with 8 bit integers
Ive gotten pretty adept at initializing the whole avr hardware but actually using it for more than a motor or a pre soldered 7 segement display wasnt really thought haha
Currently struggling with the usart thats only transmitting <0><0> in a feedback loop
id like to build a data logger I can attach to a motorcycle battery and log data from gps, acclerometer, and servo/potentiometer (suspension travel).
im a software engineer, i have a friend who's built some stuff for collecting weather/gps data. Just looking for help building a parts list.
arduino, gps, bluetooth, sd card slot, whatever I need to pevent voltage spikes from blowing up the arduino...
validation, friendhip, etc...
You should break your project
Start by getting an arduino and some of the sensors you wanna use
when you are able to get that get an SD shield or whatever to see if you can store the data
depending on the acquisition speed and the amout of data you want you can start to have problems here
so at this point you will start thinking if you should change from arduino to other stuff
after having that working start thinking about the power supply (voltage spikes and stuff I guess)
And at the end you will probably what to make it smaller and fit it in a box
so, I'll start by saying that I know that Arduino on the ESP32s2 is flaky; that being said - has anyone gotten a "Serial.print" statement to work? I'm able to upload code; however, the ESP32s2 doesnt seem to find the com port after reset. Anyone else having that problem?
Thanks for the advice. I have no idea what frequency i'll need for the data to be of use. Its important to me that I can build this as cheaply as possible in case this turns into a good idea for other people to build. My friend's already walked me though a lot of the issues he's had collecting gps and weather data. I'm just looking for recommendations on parts and making sure I buy everything I need given this is my first foray into assembling hardware.
For instance, this seems right up my alley but i dont know what the difference is between this and other gp modules. https://www.adafruit.com/product/1272
I have never used that shield... But usually Adafruit stuff is well supported and documented so I'll give it a go...
I know it looks a bit strange but you should try to build your project using these type of shields and in the future when (for example) trying to make a kit out of it, replace some of the parts for cheaper ones that you will find about while developing
Hi. I am working on my first LED/programming project. I am not sure exactly where to start. I have been googling but am overwhelmed by the number of results and different programming options. I'm trying to learn how to create/program LED animations using the hardware below. Could anyone suggest a good guide or a good search phrase for me to use to do more research? My hardware is below. Thank you for any help anyone can provide. 🙂
https://www.amazon.com/gp/product/B081PX9YFV/ref=ppx_yo_dt_b_asin_title_o01_s00?ie=UTF8&psc=1
https://www.amazon.com/gp/product/B01CDTEGGO/ref=ppx_yo_dt_b_asin_title_o01_s00?ie=UTF8&psc=1
@flint birch Few questions first - Did the Mini D1 come soldered together and if so have you soldered it together?
Do you have a breadboard and jumper wires?
What do you mean soldered together?
I do have a bread board and jumper wires.
Are the header pins that came with the Mini D1 attached to it or separate?
Separate.
Do you have a soldering iron?
If not that'll be your next purchase before you can continue
I do have a soldering iron.
Or if you don't want to solder you'll need to purchase a different microcontroller
This video is a good place to start, different board but same idea - https://www.youtube.com/watch?v=3230nCz3XQA&ab_channel=learnelectronics
In this video we look the technique I use when soldering header pins to the my One Hung Lo Chinese Arduino clones like the Nano, Pro Mini, and Pro Micro. While this short tutorial centers on soldering the pins to these boards, the technique is applicable to situation where you need to solder header pins to a board.
The pins are inserted from th...
I have soldered before so I feel somewhat confident there, but this video should be very helpful. 🙂
I'm a mechanical engineer so I'm good with my hands. The software and coding part is where I know I am going to struggle and need help with.
Ah that video is just more on how to deal with microcontrollers coming unassembled
Also 👋 fellow meche I started my career as one and am now a software engineer
Also a tip for the future, when you get a new piece of tech, I usually like to start off by googling "arduino [part name here]"
I'm not familiar with the board you linked but I foound this tutorial on Google ad skimming it has it looking pretty solid: https://howtomechatronics.com/tutorials/arduino/how-to-control-ws2812b-individually-addressable-leds-using-arduino/
Might be useful to initially cut like 3 LEDs off and not use the whole strip because your arduino might not be able to power them all without external power
For that I got a 10A power supply to power the lights. So I will have to wire that in.
This looks super helpful. Thank you! I will start reading through it and hopefully not have too many issues.
That's cool. 🙂 I know I could never do software though. Way beyond me.
If I were you, I'd avoid the power supply to begin with. Unless you're absolutely sure you know what you're doing. You can't really do any harm with the power coming out of an arduino connected just to a computer. A power supply connected to the wall can be quite dangerous
How do you mean?
Anyone reading along want to chime in? I'm doing research to follow up on my answer and maybe your power supply is ok?
and maybe I'm wrong
Sounds like I'm wrong
OK. I would also make sure to insulate everything properly before powering anything on. Do not want to electrocute myself.
How do you actually learn to make animations though? I keep seeing people mention libraries to use, but I don't understand how to get them and then know what they can do?
Welcome to the art side of things 😄
Oh boy. Is it easier than the coding side?
Well you write the code to do the art
How do you learn the commands or code words to do that?
I'm not trying to sound stupid, I just have no idea how to do that or find that.
I want to make animations like this.
Make your own at https://www.instructables.com/member/Hartvik/instructables/
3D print files https://www.thingiverse.com/thing:4691935
Music: "Marble Machine" by Wintergatan
This track can be downloaded for free at www.wintergatan.net
Free License to use this track in your video can be downloaded at www.wintergatan.net
LED_COUNT = 5
# Start LEDS as black
LEDS = [(0,0,0) for i in range(LED_COUNT)]
i = 0
while True: #Run the code forever
LEDS[i] = (255,255,255) # set one LED to WHITE
print(LEDS)
time.sleep(1) # Wait for 1 second
LEDS[i] = (0, 0, 0) # set one LED to BLACK
i += 1
if i == LED_COUNT:
i = 0```
This code will take 5 LEDS, and light one of them up at a time. When it gets to the end of the strand of lights, it starts over again
^ This would be a starting point for that first part of the video. And instead of just lighting up one LED you could set the previous led to half brightness and the next led to half brightness
and you could get that glowing effect
Oh man. I've got a lot of learning ahead of me.
😄
Can't it all just be as easy as hello world?
You can always find code that other people have written but then, your LEDs will only do what they've designed them to do
Junior devs ask me, "does it get easier with time?" Well sort of. It's get easy to solve the easy problems but then you start doing harder things 😛
(Preface: i have zero idea if this works) But I just googled "arduino library for LED strands" and I found this page: https://github.com/pololu/pololu-led-strip-arduino
Would I be able to change or modify that code?
Which if you look at the examples, can do things like "LEDStripRainbow" which sounds like making a wave of rainbow color in your strip
Depends on what you mean by "modify"
Awesome! Thank you so much for such a great starting point! 🙂
If they make the functionality readily available to modify - sure. If you have to dig into their source code to modify things get a bit more difficult
Sometimes you'll get code like this: ```from some_led_library_from_some_person import rainbow_leds
rainbow_leds(number_of_leds = 10)```
Where literally the only thing you can change is the number_of_leds
I will steer clear of complicated for now. Maybe in a few lifetimes I would be able to do complicated.
Hah I started that journey a few years ago. Good luk!
just a note -- those are python examples, not Arduino.
Isn't that what the P in Python is for 😉
Thank you again for all of the help! 🙂
Good luck -- This server is a great place to come for help.
If really not confident with programming, consider messing around with Snap as your programming interface. Downside: hard to copy other peoples' code. Upside: no errors because of missing punctuation. https://snap4arduino.rocks/ That instructible looks nice and doable too. I've never used complicated LED stuff like that with snap, so I doubt that's possible.
Ok, I'm trying to upload a sketch, and this is the error I'm getting. fork/exec /Users/kattni/Library/Arduino15/packages/adafruit/tools/arm-none-eabi-gcc/9-2019q4/bin/arm-none-eabi-g++: no such file or directoryNot sure how to go about fixing this.
Note I am basically a complete noob with Arduino.
what's the target board? like what Tools->Board is set to
did you install the SAMD board support package?
Um....
I don't know. I haven't used things in a while.
Like through the board manager?
I updated the thing in the board manager that added QT Py
Did that a few minutes ago.
Maybe restart Arduino
check both Arduino SAMD and Adafruit SAMD
Arduino one is installed too
Restarting didn't work.
pop out to a shell and nav to that folder and see what all is there
Trying to finish this friggen guide before I'm done for the week, and a screenshot of this sensor working in Arduino is literally the last thing I need. 😖
Dang, that’s frustrating
arm-none-eabi-addr2line arm-none-eabi-gcc arm-none-eabi-gdb arm-none-eabi-objcopy
arm-none-eabi-ar arm-none-eabi-gcc-ar arm-none-eabi-gdb-add-index arm-none-eabi-objdump
arm-none-eabi-as arm-none-eabi-gcc-nm arm-none-eabi-gdb-add-index-py arm-none-eabi-ranlib
arm-none-eabi-c++ arm-none-eabi-gcc-ranlib arm-none-eabi-gdb-py arm-none-eabi-readelf
arm-none-eabi-c++filt arm-none-eabi-gcov arm-none-eabi-gprof arm-none-eabi-size
arm-none-eabi-cpp arm-none-eabi-gcov-dump arm-none-eabi-ld arm-none-eabi-strings
arm-none-eabi-elfedit arm-none-eabi-gcov-tool arm-none-eabi-nm arm-none-eabi-strip```
so the file is missing apparently.
what dir is that?
/Users/kattni/Library/Arduino15/packages/adafruit/tools/arm-none-eabi-gcc/9-2019q4/bin
bin$ ls
arm-none-eabi-addr2line arm-none-eabi-gcc-nm arm-none-eabi-ld.bfd
arm-none-eabi-ar arm-none-eabi-gcc-ranlib arm-none-eabi-nm
arm-none-eabi-as arm-none-eabi-gcov arm-none-eabi-objcopy
arm-none-eabi-c++ arm-none-eabi-gcov-dump arm-none-eabi-objdump
arm-none-eabi-c++filt arm-none-eabi-gcov-tool arm-none-eabi-ranlib
arm-none-eabi-cpp arm-none-eabi-gdb arm-none-eabi-readelf
arm-none-eabi-elfedit arm-none-eabi-gdb-add-index arm-none-eabi-size
arm-none-eabi-g++ arm-none-eabi-gdb-add-index-py arm-none-eabi-strings
arm-none-eabi-gcc arm-none-eabi-gdb-py arm-none-eabi-strip
arm-none-eabi-gcc-9.2.1 arm-none-eabi-gprof
arm-none-eabi-gcc-ar arm-none-eabi-ld
sounds like you only did the SAMD board install a few minutes ago?
No, it was installed previously, I updated it a few minutes ago
so you've been able to build for SAMD boards before?
as far as I know, yes.
But honestly I'm not sure what other boards I've used.
Reinstalling the board package
removed it and installing it again
It's taking ages "Installing tools". Maybe that's a good thing
Ok now it's doing something different.
Global variables use 609 bytes of dynamic memory.
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding```
Also, interesting, CircuitPython serial output shows up in the serial monitor. TIL.
oh
it borked which board I was using
It worked!
Thanks @gilded swift and @leaden walrus. Appreciate the assist.
🙂
I clicked "remove" in the board manager. And then installed it again.
glad that worked 🙂
Me too. Oi. Just in time for me to say in the internal meeting that I had it working to finish the guide.
i've seen cases that have required manually deleting that dir
This has happened to me on more than one occasion
Screenshot obtained, and guide is ready for moderation. Whew!
🥳
Just In Time Engineering
Pretty much.
power outages can cause it too 🙂
Hello I have all this parts + a remote somewhere I was wondering if I could make the motor spin with the remote or with some app on the phone
Tag me please.
@eager umbra Well what are these parts? If you use a remote (infrared), you need an infrared sensor. If you want to use your phone with bluetooth, you need a Bluetooth module.
@eager umbra I think I actually see an Infrared sensor on your Arduino Shield
It came with a remote so I assume it has an infrared sensor
And I'm not sure but I think the blue thing is bluetooth sensor?
So is it possible with the parts I have? @vagrant spade
So then you can probably at least to it with the remote
Can you find the part name of the blue thing?
Yes, I think that might be the HC-05 bluetooth module
The one to the right is a Full-bridge DC motor driver L298N
So, where do I connect each thing? I used to know it all but I completely forgot everything 😬
No worries. There are a lot of tutorials on YouTube and Instructables. Do you want to use the IR sensor or the bluetooth module?
I think bluetooth is better
Alright. Then you don't need the Arduino Shield.
I would suggest connecting one module at a time to understand how they work. For example start by controlling the motor without the Bluetooth module. Then try just connecting to the bluetooth module, and lastly connect it all together
The Arduino shield is the big one?
The arduino shield is the one sitting on top of the arduino
Try connecting the L298N as in the tutorial above. If there is no power to the motor, the L298N might be dead
Alright
If the motor driver is burned out, you could also use a transistor if you have some other parts
What's that?
A transistor is a semiconductor that in your case, you can use as a switch to turn on and of the motor. You can connect one pin of the transistor to the arduino, and then control the current flowing through the transistor (and also the motor)
Like this
Ok I think the L298N is dead can I use the shield with the IR sensor?
I'm afraid you will need some form of motor driver. Either the L298N or a transistor
If you connect the motor directly to the arduino pin, it might draw too much current for the arduino to handle
Hmm, I guess I'll have to get a new one then..
Hi, I'm working on a project using the LC709203F battery fuel gauge module from Adafruit. I got the module working using the example code but my question now as someone with limited knowledge of arduino I'm now trying to figure out how to check multiple of these modules on the same I2C line. The boards all have the same default address which is 0x0B. I'm just kind of stuck on how to best modify the example code and or library in order to chain a couple of these together and monitor multiple batteries. https://learn.adafruit.com/adafruit-lc709203f-lipo-lipoly-battery-monitor/arduino-use
@teal bane afaict, there is no ability to change the I2C address, so you'll have to use an I2C multiplexer
^^ yep. i'm also not seeing an alternate address
(SparkFun has one with Qwiic connectors https://www.sparkfun.com/products/16784)
(adafruit stocks it too)
Alright. I'd been digging around in the datasheet for the chip and looking at adafruits library and it looked like it could be set but it would require changing the library. That multiplexer looks like a much easier solution. Thanks!
Could anyone recommend a method to read 6 quadrature encoders? (12 signals total)
I'm reading that ISRs are the best method to sense encoder signals, but arduino uno boards only have 2 interrupt pins?
The goal is to get accurate state odometry on a 6 wheeled car
Why would you start a complex project using an Uno? ;)
It was lying around -- just wondering if there are other boards that have more interrupts? or secondary boards that count the encoders separately?
Does anyone know if there is any plan to port ArduinoSound library to nrf52 board(s)? bluefruit sense, specifically
@split tapir Since you're here, look at the Grand Central. It's SAMD51. See if it does what you want.
Then you can downgrade your requirements to find a lesser board that matches them. That's approximately how I do it, or I just grab the most complex board I own, in some cases, and do a work-up.
I think that ATSAMD51J19A does have internal hardware specific to rotary encoders.
Maybe that ItsyBitsyM4 has enough interrupts .. I don't know offhand.
there doesn't seem to be a samd51 board with as many packed-in sensors as the bluefruit sense / arduino nano ble sense
It does, called the PDEC if I remember right
Hello everyone! I'm making a servo code and I'm recieving an error which says "expected primary-expression before ";" token" in this code :```
/*
Servo Motor
Move a servo attached to pin 9 so that it's angle matches a potentiometer attached to A0.
*/
int potentiometer = A0;
//include the servo library
#include <Servo.h>
//define a variable 'potPosition' that will store the position of the potentiometer
int potPosition = analogRead(potentiometer);
//define a variable, 'servoPosition', so that the servo will move to this position
int servoPosition = Servo;
//create a servo object
Servo myServo;
void setup() {
myServo.attach(9);
}
void loop() {
//use analog read to measure the position of the potentiometer (0-1023) and store it in potPosition
potPosition = analogRead(potentiometer);
servoPosition = map(potPosition, 0, 1023, 20, 160); //convert the potentiometer number to a servo position from 20-160
//Note: its best to avoid driving the little SIK servos all the
//way to 0 or 180 degrees it can cause the motor to jitter, which is bad for the servo.
//move the servo to the degree position determined by servoPosition
myServo.write(servoPosition);
}
The line int servoPosition = Servo looks suspicious to me, since two lines later Servo is used as a class.
Use pastebin or github gist to post your big code. Include a copy and paste of the error message to get better help.
Sure here : https://pastebin.com/2Ry13iV4
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
What do you mean by it looking suspicious?
Oh do I set it as 0 to read to positioning?
What value do you think Servo has on line 14? It's a syntax error to assign a class to an int.
Do you have a guide you are following? Check it or the docs for exactly how to tell a Servo what pins to use to control the servo.
I shouldn't have set it to Servo, that was my fault. It's meant to be used to read the values for potPosition so I believe it has to be set to 0, right?
Any value will be fine.
Even after replacing that value, the potentiometer doesn't seem to be in sync with the servo motor
Next step is to calibrate it.
Find the lowest reading your potentiometer gives, make that the bottom of the map range.
Highest -> top of map.
Or whatever positions of the pot you want to actively control the servo.
as in " servoPosition = map(potPosition, 0, 1023, 20, 160); " ?
this is my smoke machine controller 😛 LED lights up when the smoke machine is warm enough and ready to put out smoke and the other is a push button to yea... release smoke! how would i connect this to my ESP32 to be able to "push the button" to put out smoke and also detect when the smoke machine is ready (the LED wires)?
Hi. Would someone be able to help me set up an Organizer ESP8266 ESP-12 to work with arduino? I am trying to follow the tutorial below but I am not able to get the test code to work.
https://www.instructables.com/Programming-the-ESP8266-12E-using-Arduino-software/
Programming the ESP8266-12E Using Arduino Software/IDE: The ESP8266 is like an Arduino with a builtin WiFi, the MCU and WiFi circuitry are in the same chip. Consider Arduino + WiFi Shield = ESP8266. In this instructable I will provide a step by step guide to procure and programming an ESP8266-12E WIFI De…
@flint birch You should provide more details about how far you got and concrete evidence of what the problem is. Pastebin.com or a github gist to share code/errors is the way to go. Screenshots if that's what the issue is. If no errors, what have you done to diagnose the problem. It's annoyingly detailed engineering until you get off the ground.
OK. One second.
I am brand new to programming so I will be very ignorant, but I am trying to learn.
This is the error that I am getting when trying to upload that sample code.
Executable segment sizes:
IROM : 228640 - code in flash (default or ICACHE_FLASH_ATTR)
IRAM : 26756 / 32768 - code in IRAM (ICACHE_RAM_ATTR, ISRs...)
DATA : 1248 ) - initialized variables (global, static) in RAM/HEAP
RODATA : 688 ) / 81920 - constants (global, static) in RAM/HEAP
BSS : 24880 ) - zeroed variables (global, static) in RAM/HEAP
Sketch uses 257332 bytes (24%) of program storage space. Maximum is 1044464 bytes.
Global variables use 26816 bytes (32%) of dynamic memory, leaving 55104 bytes for local variables. Maximum is 81920 bytes.
An error occurred while uploading the sketch
esptool.py v2.8
Serial port COM4
Connecting....
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: 3c:61:05:cf:f7:db
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 261488 bytes to 193158...
Wrote 261488 bytes (193158 compressed) at 0x00000000 in 17.0 seconds (effective 122.8 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
Is this what you need? It is what appears at the bottom of the arduino screen.
That is not what I expected to see. It appears successful. (Good all the way to "Hash of data verified"). I think you'll need someone with more experience than me.
Google the error "Leaving... Hard resetting via RTS pin... ESP8266". There's plenty of writeups about it.
You don't say what sketch you're running, but hopefully it is something like blink so it's obvious if/when it does actually work.
Yes. This is the example code that was given.
const short int BUILTIN_LED1 = 2; //GPIO2
const short int BUILTIN_LED2 = 16;//GPIO16
void setup() {
pinMode(BUILTIN_LED1, OUTPUT); // Initialize the BUILTIN_LED1 pin as an output
pinMode(BUILTIN_LED2, OUTPUT); // Initialize the BUILTIN_LED2 pin as an output
}
void loop() {
digitalWrite(BUILTIN_LED1, LOW); // Turn the LED ON by making the voltage LOW digitalWrite(BUILTIN_LED2, HIGH); // Turn the LED off by making the voltage HIGH delay(1000); // Wait for a second
digitalWrite(BUILTIN_LED1, HIGH); // Turn the LED off by making the voltage HIGH
digitalWrite(BUILTIN_LED2, LOW); // Turn the LED ON by making the voltage LOW
delay(2000); // Wait for two seconds
}
I shall start googling. Thank you. 🙂
if you put code enclosed in triple back-ticks it looks nicer
I'm sorry, I don't know what that means.
In the upper left corner of the keyboard there is this: `
Putting one around your code make it look monospace
Putting three on a line by themselves starts&ends a block of monospace.
hey guys, I'm having an interesting issue with neopixels and I'm wondering if anyone else has encountered it. I have my code set to fill 40 neopixels with white light, but it's fluctuating between colors even though I'm using two commands, fill() and show(). does anyone know why this might be happening? thanks
duncanj did the basic demo work? what kind of troubleshooting have you done? does 1 pixel work as expected? 2? post the code in a pastebin if you have a working demo
Awesome. Thank you.
im looking at digitalRead documentation and it5 5aying ```Notes and Warnings
If the pin isn’t connected to anything, digitalRead() can return either HIGH or LOW (and this can change randomly).
The analog input pins can be used as digital pins, referred to as A0, A1, etc. The exception is the Arduino Nano, Pro Mini, and Mini’s A6 and A7 pins, which can only be used as analog inputs.
doe5 it mean that
fi the pin i5nt connectedd to anything phy5ical
like a real pin
or doe5 it mean that if the pin i5nt connected to neither ground nor live
doing te5ting it would 5eem that it5 the fir5t ca5e
I'll try to explain as brief as possible, then I'll post the relevant code that I'm using. I've used neopixels before and have been able to get them up and running okay. I'm using 2 rings, 24, and 16. I can get the basic code to work, but not all 40 neopixels illuminate. I checked the soldering I did and it looks completely fine. It seems to be something with the for loop, like it lights up the individual r g b pixels, so the count finishes before illuminating the whole ring. if I boost the number of pixels up, it works
maybe pixels.clear() is messing me up when it comes to fluctuating colors
?
post code, somebody will read it. https://pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
thanks, I'll give it a go
key part of description
if I boost the number of pixels up, it works
yeah it's a really strange issue. A few months ago I used two rings and a gemma m0 to backlight a lithophane fine, but with low brightness to limit the current draw. Now I'm using a 5V 10A and I'm getting fluctuations in colors even though I'm using pixels.fill(16777215,0,numpixels); at 75% brightness. So strange to me.
same issues with just one ring, or no?
yeah if I define numpixels as 24, not all 24 light up. you think this could be due to my mistake of not putting a resistor between micro and data input for the rings?
can you light individual pixels ? like if you just try to light the 40th what happens ?
one sec, let me upload code for that
yeah, we think you need to work on isolating the problem. right now u haven't even figured out if it's hardware or code. very simple code should make it easier to blame/not blame that part
simplify hardware setup too, if you can detach some stuff physically
I would agree, I'm going to splice in a resistor really quick and see what that does
you're guessing. simplify first. unless you're lucky
Is it possible that my serial transmit code interferes with my digital direct synthesis. I am getting distortion when I transmit the the pwm registers value to plot it. and its a clean signal without any transmission.
I can see the distortion as well on the plot. but I cant explain it
{
OCR2B = 128+My_DDS.pwmvalue;
}
ISR (TIMER2_COMPA_vect)
{
My_DDS.accumulator_steps = 1760;
My_DDS.accumulator += My_DDS.accumulator_steps;
My_DDS.step = (My_DDS.accumulator >> 8);
My_DDS.pwmvalue = fullSine[My_DDS.step];
}```
{
loop_until_bit_is_set(UCSR0A, UDRE0);
UDR0 = byte;
}
kind of, but the adafruit neopixel uber guide along with others on arduino forum say resistor is necessary, so i'm trying to eliminate room for error
I really can't explain why it oscillates so much
Could the fluctuations be because i am transmitting slower than the interrupt? 9600 baud vs 8bit timer with no prescaler
On a f_cpu of 16mhz
@native kelp >> If the pin isn’t connected to anything..<<
I take that to mean they're telling you not to let the pin float if using digitalRead() on it.
(as opposed to, say, not letting any pin float - just that one pin) (perhaps)
That's their way of saying use a pullup (or a pull-down) resistor, I think.
okay then
pinMode(pin, INPUT); // set pin to input
digitalWrite(pin, HIGH); // turn on pullup resistors
Since you're pulling up to Vcc, you ground it to register a pushbutton press.
Then, a finite (and very reasonable) current flows through your switch (to ground).
Try INPUT_PULLUP instead of PULLUP .. initially. See if it meets your needs.
(I don't know the differences, if any)
I think the above code block applies the most to a programming system that does not feature INPUT_PULLUP but I could be mistaken.
(Like maybe an AVR BSP?)
well i didnt really encounter anything weird happening to the pin reading while i wa5 doing my 5mall te5ting, but i'll keep that in mind
@shadow marlin pretty sure I figured it out. Seems to have been an issue with my code. I overlooked adding NEO_RGBW instead of NEO_RGB. Now all LEDs light when defined, and don't fluctuate color.
Glad to hear it.
I'm unable to flash my esp32 arduino. When it tries to connect, the 'timed out waiting for packet header' error occurs. If I connect gpio0 to gnd, and press the reset button (only button on the board), I get this output in the terminal:
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0xb (HSPI_FLASH_BOOT)
flash read err, 1000
ets_main.c 371
I am not sure what to do next. Any help would be appreciated.
On the Feather M4, several pins share the same interrupt number, according to the pinout diagram. Does this mean that if I enable interrupts on one pin, would another pin that shares that same interrupt number going HIGH/LOW trigger that interrupt?
I think I figured out my issue. I am using the SAMD51 on a custom PCB with the Adafruit bootloader and board definitions. On this board, I need digital pin 8 to be an interrupt, which is used for the neopixel on the Feather board. I thought this was possible, as it says there is an interrupt on that pin in the pinout diagram. However in the variant.h, it says there isn't an interrupt on this pin.
{ PORTB, 3, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, //neopix
Is there any way I can assign an interrupt to this pin?
Change the variant.h file
Do I need to do anything else? I can just replace EXTERNAL_INT_NONE with EXTERNAL_INT_3 (the corresponding interrupt for the pin in the pinout diagram) and it should work?
Eh.. interrupts use timers
I would think if you removed timers and external int you would be fine
Some of the other interrupt enabled pins don't seem to have timers
{ PORTA, 2, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel0, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 },
{ PORTA, 5, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel5, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_5 },
Or copy what’s there
What do you mean by "removed timers"?
Probably safer to just copy what they have
D9 PA19 is also I3
I’m used to setting up timers with ISRs
So you have to disable the interrupt I3 on PA19 to use it on PB03.
It’s a more low level C thing than an Arduino thing
Got it.
Yeah also what @pine bramble mentioned
variant.cpp iirc
Ok... this is easier than I expected. Thanks!
Should be fine but let us know. ;)
After seeing all this the datasheet would probably give more insight.
I'd rather address the code problem, then look at the datasheet as a sanity check, than the other way around. ;)
Also there's some deep hardware stuff in Atmel Start projects that shed light on all of this.
bitbanged-serial-a/include/pio
$ ag EXTINT3 samd51j19a.h | cat
286:#define PIN_PA03A_EIC_EXTINT3 _L_(3) /**< \brief EIC signal: EXTINT3 on PA03 mux A */
287:#define MUX_PA03A_EIC_EXTINT3 _L_(0)
288:#define PINMUX_PA03A_EIC_EXTINT3 ((PIN_PA03A_EIC_EXTINT3 << 16) | MUX_PA03A_EIC_EXTINT3)
289:#define PORT_PA03A_EIC_EXTINT3 (_UL_(1) << 3)
291:#define PIN_PA19A_EIC_EXTINT3 _L_(19) /**< \brief EIC signal: EXTINT3 on PA19 mux A */
292:#define MUX_PA19A_EIC_EXTINT3 _L_(0)
293:#define PINMUX_PA19A_EIC_EXTINT3 ((PIN_PA19A_EIC_EXTINT3 << 16) | MUX_PA19A_EIC_EXTINT3)
294:#define PORT_PA19A_EIC_EXTINT3 (_UL_(1) << 19)
296:#define PIN_PB03A_EIC_EXTINT3 _L_(35) /**< \brief EIC signal: EXTINT3 on PB03 mux A */
297:#define MUX_PB03A_EIC_EXTINT3 _L_(0)
298:#define PINMUX_PB03A_EIC_EXTINT3 ((PIN_PB03A_EIC_EXTINT3 << 16) | MUX_PB03A_EIC_EXTINT3)
299:#define PORT_PB03A_EIC_EXTINT3 (_UL_(1) << 3)
$
from:
I assumed ATSAMD51J19A but I did not look it up!
So I'm useing an attiny to blink an RGB-led.
and blink red if the batt is low, yellow if its getting low and GREEN if the battery is fine.
I am doing the sencing through pin 2 connected directly to the battery.
NA 1-[* ]-8 VCC+
Bat+ 2-[ ]-7 RED led
NA 3-[ ]-6 GREEN led
GND 4-[ ]-5 BLUE led
This is the basic pin-out currently.
however the attiny will not power off when I unhook VCC. Because it is pulling the power from the batt through pin 2.
Any ideas?
Use a voltage divider, maybe.
That way the voltage on pin 2 isn't high enough to power the microcontroller core.
Thanks guys, I changed what you suggested and it worked perfectly!
sweet .. good deal, MaxThe
Great to hear
I see common written on the datasheet for an encoder, whay does it mean?
Nvm
;)
I am trying to make 3 ledstrips be controlled by one adruino UNO. This is possible right? because I cannot seem to get it working.
Do I define my ledstrips like this
Adafruit_NeoPixel strip1(NUMPIXELS, 4, NEO_RGBW + NEO_KHZ800);
Adafruit_NeoPixel strip2(NUMPIXELS, 5, NEO_RGBW + NEO_KHZ800);
Adafruit_NeoPixel strip3(NUMPIXELS, 6, NEO_RGBW + NEO_KHZ800);
The uberguide seems to agree (https://learn.adafruit.com/adafruit-neopixel-uberguide/arduino-library-use)
@glacial spire Start with just a few LEDs on each strip - not the entire strip, in your programming.
The software has no 'idea' it's talking to a very long strip.
The strip will behave as a shorter strip if you program it to.
If you can manipulate, say, 4 RGB's per strip on all three, then you've proven the electrical connections.
Don't try anything with DMA as I think that needs special hardware support.
I have electrical connection problems.
That'll do it. ;)
I connected all the strips to one pin now. Just to 6
Only 1 ledstrip actually reacts.
You can connect them in series (for data transfer) but not in parallel.
so the end of one strip feeds the start of the next strip (that's what series means, here).
You can also swap out strips to test each individually, to ensure you have, in fact, three good strips that'll function correctly when everything else is correct.
A lot of beginners will jump to the conclusion their stuff is broken, when it's not.
I know and I am a beginner. But I am just trying to find an explination why it could not work.
The easiest way forward is to start with known good hardware, get it working, then swap out parts.
I do my best to have 2 or 3 examples of anything that's apt to be puzzling.
For the Uno you can prove a lot just by for example connecting an LED to the same pin you wanted to connect an RGB strip to. Use a current limiting resistor (about 1k is fine).
If it will blink that LED the chances are excellent it will also control your RGB strip successfully.
one of my pin5 when being read with digitalread give5 me completely garbled data
not even 1 or 0
what could be the cau5e of that?
like thi5
actually
nvm
Random question, for the Circuit Playground Express, what would be the easiest way to mirror the state of the IR receiver to an external pin? (e.g. for connecting to a scope)
edit: I just ended up going the lazy route and using an interrupt
this is a diagram of a setup I have connecting a QT PY to a neopixel. does anyone know why it works with separate power supplies, but not when using a splitter connected to a 5V 10A supply to power both the neopixels and QT PY? btw the way, I also have a pump getting triggered by A3 and it works completely fine when using a splitter. it's only the neopixels that are having a problem
You need a shared voltage reference
@north stream they both are connected to the same surge protector in the end. My desktop shares a surge protector with the 5V 10A supply
but if I use a splitter from the 5V 10A to both the rail powering the neopixel, and the qt py, shouldn't it work? or is that where you're saying I should have a shared reference?
Yes, the LEDs and the controller need a reference, not just one wire can make a circuit
You just need to tie the 0V from the controller to the 0V on the LEDs
by 0V you mean the ground? sorry i'm a noob with this terminology
@north stream also what’s weird tho is that the dc pump which is triggered by the qt py is working with both configurations, it’s just the LEDs that are acting strange
I'm unsure how the pump is connected. Many people call 0V "ground", but it's technically a misnomer
@north stream just like the neopixels, I have a 3.3V buck converter connected to the vertical rails on the board. Then using a transistor, I have A3 going to the gate, the collector goes to the red wire on the pump, and the pumps black wire goes back to the ground on the vertical rails
Hmm. Your schematic doesn't show those connections.
@north stream it was a simplified schematic because as far as I can tell, everything works in either configuration except the neopixels. I could draw up a more in-depth one though of the entire circuit
Could someone help me test if my ESP12 and LEDs are working with some simple code for an arduino? I've been trying the blink command but I cant get anything to light up. Fair warning, I am a complete beginner at this.
Got a photo of your circuit and can you share your code?
Yes. One second.
Code:
// How many leds in your strip?
#define NUM_LEDS 1
// For led chips like Neopixels, which have a data line, ground, and power, you just
// need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock,
// ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN
#define DATA_PIN 6
#define CLOCK_PIN 13
// Define the array of leds
CRGB leds[NUM_LEDS];
void setup() {
// Uncomment/edit one of the following lines for your leds arrangement.
// FastLED.addLeds<TM1803, DATA_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<TM1804, DATA_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<TM1809, DATA_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<WS2811, DATA_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<WS2812, DATA_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<WS2812B, DATA_PIN, RGB>(leds, NUM_LEDS);
FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
// FastLED.addLeds<UCS1903, DATA_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<UCS1903B, DATA_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<GW6205, DATA_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<GW6205_400, DATA_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<WS2801, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<SM16716, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<LPD8806, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<WS2801, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<SM16716, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<LPD8806, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
}
void loop() {
// Turn the LED on, then pause
leds[0] = CRGB::Red;
FastLED.show();
delay(500);
// Now turn the LED off, then pause
leds[0] = CRGB::Black;
FastLED.show();
delay(500);
}```
This was example code I found.
@north stream this is the entire circuit. What happens is that if I use a splitter on that power brick and then use it to power what it does in the picture, and then also the qtpy, the LEDs stop working, but the pump continues to respond to the changes observed in the soil sensor. The fact that the pump still works in conjunction with the soil sensor makes me think there is already a shared reference voltage
By that circuit the side with the power brick is not sharing a ground connection with the QTPY. Going back through devices to the surge protector doesn't work as a common ground. Generally speaking ground connections in electronics circuits have to share a common ground (sometimes call zero volt ground among other things). Voltage is relative to ground. Having two parts of a circuit on isolated grounds can cause issues. There are times where this isn't true, but I don't think this is one of them. Having isolated grounds may cause unexpected results, or even some good old blue smoke, in some circuits.
That is this circuit, which works flawlessly when plugged in with separate supplies to one surge protector. I can totally get behind them not sharing common ground, but then why would it work??
The situation where it doesn’t work, is this one @solemn star wouldn't using the splitter require them to share a common ground? If so, why does this case not work, but the one where they don't share, does?
Let me look further at it. I appologize, completely misread what you had said earlier.
No need to apologize @solemn star it's complicated for me to convey what I'm saying in only text, I didn't want to feel like I was spamming images
@flint birch Can you verify that your breadboard is making the connections that you expect it to? (Multimeter or something?) The ones I have that look like that are connected "horizontally".Your breadboard might connect the two leads from the capacitor and not the red wires together.
I'm not actually sure why the neopixels are working in either case. The microcontroller doesn't seem to have a common ground connection to the neopixels in either scenario. But maybe I'm missing something and someone else on this board will see it. I'm not familiar enough with the QTPY to know if the usb ground is common with the ground pin on the QTPY.
@solemn star even in the second configuration where they share the same power supply? When it’s plugged in like that, I can use a multimeter to measure 5V between the proto board rail and the qtpy ground pin
I'm trying to setup serial comms between an arduino and python, so I can control some NeoPixels. I've got this code I mostly copied from a post on the arduino forums, that's not working. I think the problem is that newData never gets set to true, but I'm not 100% sure.
Arduino code: https://pastebin.com/JT9WRHES
Python code: https://pastebin.com/nNrw3sMQ
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
@winter ridge it looks like the python code never sends the start or end markers
It was doing, I changed them in the arduino code while I was using a different python program
With a loop!
Hello everyone!
i am making a project with a sim900a gsm module. i am using the following code:-
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3);
void setup()
{
mySerial.begin(9600); // Setting the baud rate of GSM Module
Serial.begin(9600); // Setting the baud rate of Serial Monitor (Arduino)
delay(100);
}
void loop()
{
if (Serial.available()>0)
switch(Serial.read())
{
case 's':
delay(1000);
mySerial.println("AT+CMGF=1"); //Sets the GSM Module in Text Mode
delay(1000); // Delay of 1 second
mySerial.println("AT+CMGS=\"+91xxxxxxxxxx\"\r"); // Replace x with mobile number
delay(1000);
mySerial.println("Hello World");// The SMS text you want to send
delay(1000);
mySerial.println((char)26);// ASCII code of CTRL+Z for saying the end of sms to the module
delay(1000);
break;
case 'r':
mySerial.println("AT+CNMI=2,2,0,0,0"); // AT Command to receive a live SMS
delay(1000);
break;
}
if (mySerial.available()>0)
Serial.write(mySerial.read());
}```
so when i run it, i have to send "s" in the serial port
but when i send it, the following message is showing:-
```AT+CMGF=1
OK
AT+CMGS="+91xxxxxxxxxx"
> Hello World
>```
the problem is that the message is not sent in the destination number
I want help with this!
Thanks in advance
Looks like it's doing the right thing, I'm not sure what you want to change. Presumably the module is echoing the commands you send it, then your loop is returning them
i don't want to change anything.
the problem is that the message is not sent😢
Hmm, I wonder if you need to set the service center address or it doesn't like the delay. Normally I just use the FONA library instead of sending the commands directly.
@wispy crater if Im not mistaken bodger is referring to this library which has example code https://github.com/adafruit/Adafruit_FONA/tree/master/examples
But, as SIM800/SIM900 seem grouped together AT command wise, seems you have a lot of options https://github.com/topics/sim900
okay thank you so much guys
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00
An error occurred while uploading the sketch
what is this error?
It's trying to talk to the bootloader to install some code, but isn't getting the response it's expecting
oka
can anyone tell me what can i do if my 16*2 i2c lcd is not displaying any text ,instead, a single black line on the upper row
LiquidCrystal_I2C lcd(0x27,16,2);
void setup() {
lcd.begin(16,2);
lcd.backlight();
lcd.clear();
lcd.print("yay");
}
void loop() {
}
here is the code
and i have already resoldered the lcd multiple times today
yeah sure
just a min
here it is @thick stag
a simple setup with 4 wires
but is is not displaying anything
I need a photo of the wires
your wires are most likely not setup correctly
no need to solder anything to the arduino itself
yeah i didn't
You said you resoldered multiple times? I'm not sure what you're referring to
I resoldered the i2c to the lcd multiple times
So long as your solder isn't bridging (see photo) there's no need to resolder
The photo I need is to be able to follow each of the wires from the arduino to the lcd
or you can draw it out in mspaint or something
got a better photo I can't tell where each wire goes
Have you tried sticking a screw driver to the blue box?
yup
and rotating all the way left and right
I have this software problem that I have been trying to fix.
I can do this and buff will contain the correct telemetry data locally:
bool VehicleTelemetry::receiveTelemetry(uint8_t telem[], uint8_t len) {
uint8_t buff[235];
uint8_t size = sizeof(buff);
if (!_loraDriver->recv(buff, &size)) {
return false;
} else {
for(int i=0; i<sizeof(buff); i++){
printHex(buff[i]);
}
}
return true;
}
But whenever I pass in an array to receiveTelemetry and try to read the data into there it doesn't work (runtime not compile error). telem does not contain the data when I read locally or outside the function. Does anyone know why? I imagine it has to do something with pointers.
bool VehicleTelemetry::receiveTelemetry(uint8_t telem[], uint8_t len) {
if (!_loraDriver->recv(telem, &len)) {
return false;
} else {
for(int i=0; i<len; i++){
printHex(telem[i]);
}
}
return true;
}
@wispy crater Try the code here -> https://circuits4you.com/2016/09/17/i2c-lcd-arduino/
What does the Serial monitor say
okay
Mayhaps you have a bad device or there was an error with soldering
Could try replacing all the jumper wires
🤷♂️ lol
Welcome to aruino.
lol good luck
😁
You aren't showing the problem part of the code.
You need to show a short example that does not work.
You should also include the error that you get when it fails. And what line the error is on, if you can figure that out (presumably in the recv call, but you need to make sure of that).
Otherwise we're just guessing. But I will guess that you have not actually allocated space for telem in the caller, and you get a segfault.
I understand, I’ll get you an example program
@shadow marlin Here is the example program. I was able to reproduce the issue with it. Many more details about error and install at top of main file. Thanks for taking a look!
next time dump it to pastebin or a github gist so people can read it without downloading
putting it into gh now
Github for anyone else who want to take a look https://github.com/MaxMaeder/RadioHead-Error
i don't see the error i was expecting to see. can you move the declaration of serializedTelem into the loop and see if that makes any difference?
global vs local weirdness
hope that's enough for you to go again.
if you need that variable to be global you could allocate it in the setup() and it would probably still work, using new uint8_t[235] or whatever they say in C++
@shadow marlin Thanks so much! So like make a pointer in global and allocate it using that in setup()?
Yes
That was actually an interesting problem... surprise!
Whats a decent bluetooth module that I can use with my phone ? I want to make a remote car or claw or something
Ok, thanks for clarifying. In my actual program I’m reading it into a struct using a union, and then using that struct across my program. Sorry to bother you again, but do you know any way to do that with these constraints?
I can probably do the same thing, only with the union, nevermind
I'v an Adafruit Feather Bluefruit Sense that I'm trying to use the HID-Project example Gamepad. The compile fails with fatal error:: HID.H: No such file or directory I've been going nuts trying to find the missing module. Any suggestions on where to find it?
I think that would be part of the board package or its dependencies.
Does anyone know why neopixels would only work in a circuit when not sharing a common ground with the microcontroller?
I tried that, but it didn't work. Won't the memory allocated in setup() be freed once that function ends?
BREAKTHROUGH! (not that anyone asked) but I've been posting about an issue with my circuit not lighting my neopixels when connected to a single power supply that would provide power to the qtpy, LEDs, and pump, soil sensor, and rtc. It seems that the issue was all because of the 330ohm resistor I had connecting A2 to the data pin of the LEDs. Not really sure why this is the case, but I posted the schematic a couple days ago if you want to scroll up and check it out.
Cool, I was curious, thanks for letting us know!
Dynamically allocated memory is not freed until you do it explicitly. Your function would segfault if the memory were deallocated. Assuming when you say "I tried that" you mean you dynamically allocated memory and put it in a global variable and it didn't get changed by the recv routine. If that is the case, try the same experiment with a local variable & dynamically allocated memory... something very weird happens, if you don't want to hack around you'll need to find somebody who really knows the guts of how the language works.
Ok, thanks
Anytime, you guys are all really helpful here so I figured I'd tell you guys when the project was completed. Really appreciate yours, and everyone else's, willingness to take time and give a noob some advice
We all start out as beginners
hello everyone, i am not able to send message through a "sim900a gsm module"
the code is:-
{
delay(1000);
Serial.begin(9600);
Serial.println("AT+CMGF=1");
delay(1000);
Serial.println("AT+CMGS=\"+91xxxxxxxxxx\"\r"); //replace x by your number
delay(1000);
Serial.println("hello");
delay(100);
Serial.println((char)26);
delay(1000);
}
void loop()
{
}```
it doesn't even shows any error
please help!
thanks
What error would it show? I dont see in your code a way to view the response if there was one. And did none of the libraries we mentioned before work out?
How would you see the error? Your code does not print errors
yeah it doesn't
this is the problem
Sure, but if you dont print an error, how can you say there are no errors? I would add code to your loop that lets you view the responses from the SIM900 module
Which board are you using?
arduino uno
Quick google search leads to this guide, read up to the FONA section for what Im talking about. https://www.teachmemicro.com/arduino-sim800l-tutorial/
This will let you manually send AT commands from your computer and let you see the response from the arduino serial console
Note that will require you to change the RX TX lines from the hardware serial port to a software serial port as the hardware serial port is used for the connection to the computer
okay i saw that 😁
SoftwareSerial sim800l(3,2); which one is rx and whic one is tx?
Pin 3 would be the Arduino's RX so your module TX, and pin 2 would be the Arduino TX or your modules RX
okay
For future reference when youre working on your own, you can find info like that on the Arduino reference https://www.arduino.cc/en/Reference/SoftwareSerialConstructor
Open-source electronic prototyping platform enabling users to create interactive electronic objects.
👍
okay so, when i am sending the command "AT" it is not responding
Okay one moment sorry, brb
umm
Okay sorry, was in a meeting. If you dont get an OK back then you have a hardware issue of some sort
Does your SIM900 module have a power LED?
yes
And its on correct?
yes
Im looking at the datasheet for that module, are you sending "AT" or "at"?
both
Okay, if you change your serial port to the module from 9600 baud to 115200, then while looking at the arduino serial console you unplug the power for the SIM900, then plug it back in, do you see the hex string 0 49 49 49 49 FF FF FF FF?
let me check
Following that string should also be "RDY" on another line a few seconds after
nope
Hm, could I please see your wiring?
umm
actually i am on my pc and its mid-night so my parents will not let me open the phone😅
i can show you the schematic
Fair enough, I doubt the issue is to do with the schematic, but you could send if you want. But I can say your issue is with the connections/hardware, not your arduino and software
Which even if we dont solve that tonight, that gives you a solid direction and a place to start if you need help when you can take a photo