Recent Posts

Pages: [1] 2 3 ... 10
1
Hardware / Re: Problema risposta di blynk...
Last post by andrewa980 - Today at 02:34 pm
Ragazzi le sto provando tutte....Torno sempre alla solita situazione:
Test comunicazione ESP ok, ip assegnato ok, invio lo sketch di blynk quello di base e mi da ok.
Ping dell'ip assegnato OK!
Sul cellulare ho il device connesso, provo a creare un pulsante con PIN D1 e funziona, tutto il resto no...

Non ho ancora capito una cosa, nella documentazione blynk dove c'è l'esempio più stupido di accensione led, nello sketch non leggo nulla relativo al pin D8.
Perdonatemi se dico stupidaggini. Va dichiarato o no?
Potete scrivermi un esempio stupidissimo? Non vorrei che sbagliassi io su qualcosa di basilare.
2
Microcontrollers / Re: RX interrupt on USART
Last post by manjunathele - Today at 02:33 pm
All,




here is the code as per "jigisha" instruction I successfully modified the code thanks to all.
my board is "Mega 2560" Arduino version is-1.6.9
configured interrupt uart is 2.

on output  shows 123 okay and 6 six time of "receive interrupt occur" string shows why?

Code: [Select]
output:123
receive interrupt occur
receive interrupt occur
receive interrupt occur
receive interrupt occur
receive interrupt occur
receive interrupt occur


Any one can Help me on this topic please...

Regards,
Manjunath.

Code: [Select]

#include <avr/io.h>
#include <avr/interrupt.h>
#define F_CPU 16000000
#define USART_BAUDRATE 9600
#define UBRR_VALUE (((F_CPU / (USART_BAUDRATE * 16UL))) - 1)
unsigned int u8TempData;
void USART2Init(void)
{
  // Set baud rate
  UCSR2A = 0x00; //Clear send and receive flags
  UBRR2H = (uint8_t)(UBRR_VALUE >> 8);
  UBRR2L = (uint8_t)UBRR_VALUE;
  // Set frame format to 8 data bits, no parity, 1 stop bit
  UCSR2C |= (1 << UCSZ20) | (1 << UCSZ21);
  //enable transmission and reception
  //UCSR1C = (1<<URSEL1)|(3<<UCSZ0);
  UCSR2B |= (1<<RXEN2)|(1<<TXEN2)|(1<<RXCIE2);;
}


ISR(USART2_RX_vect)
{
  Serial.println("receive interrupt occur");
  while (!(UCSR2A & (1 << RXC2))) {};

  char ReceivedByte;
  ReceivedByte = UDR2; // Fetch the received byte value into the variable "ByteReceived"
  UDR2 = ReceivedByte; // Echo back the received byte back to the computer
}

void setup ()
{
  noInterrupts();     
  pinMode(16,INPUT);
  pinMode(17,OUTPUT);

  //Initialize USART0
   USART2Init();
  //sei();
   interrupts();       

  Serial.begin(9600);

  Serial.print("123");
  //delay(100);
}
void loop()
{

}

3
Français / Re: Harpe Laser Portable
Last post by FrancoisArnaud - Today at 02:32 pm
Je peux garder le même principe au niveau du montage ? Résistance de 10k et mes photorésistances, le tout relié à l'entrée digitale de l'Arduino ??
4
Hi all,

I had some trouble withe writing some new code to my arduino nano. Last week i have put some code on it and it still runs that code.

I got this next wel known message back telling me:
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00

So i tired all the solutions i could find online and there are a lot.

In the end i thought what if i just try cleaning it up uploading a bootloader on it. Following this awesome guide here i have done this 4 times successfully already with my barebones so why not on the nano too.

However when i try the Board Detector Output i get the error message telling me to check if my wiring is correct. The precise same wiring does work on a fresh arduino, i get the whole message that i need to get.

So, my question is, are there any other options i can try? Any other obvious things? Or is my board just broken somehow? Strange since it still runs the last code and i uploaded that e couple of days ago.

I hope any of you have any idea to help me out here.

If there is more info needed please let me know what you need to know.
5
Quote
but I altered something in this program below.
Sure did, you missed the <code> tags
6
DS1307 rtc;
char dtb[100];
DHT dht(DHTPin, DHTTYPE);
SSD1306AsciiWire oled;

unsigned long currentMillis;
unsigned long previousMillis = 0;
long OnTime = 30000;
float h,t,f;
time_t lastFed;

void setup() {
  Wire.begin();
  Wire.setClock(400000L);
  oled.begin(&Adafruit128x64, I2C_ADDRESS);
  oled.setFont(System5x7);
  oled.clear();
 
  pinMode(DHTPin, INPUT);
  dht.begin();

  strncpy(dtb,"MM/DD/YY  hh:mm:ss\0",100);
  rtc.begin();
  if (! rtc.isrunning()) {
    oled.println("RTC is NOT running!");
    //sets the RTC to when this sketch was compiled
    rtc.adjust(DateTime(__DATE__, __TIME__));
  }
  DateTime now = rtc.now();

  EEPROM.get(0, lastFed);
  if(lastFed < 40000000){
    lastFed = now.unixtime();
    EEPROM.put(0,lastFed);
  }

  oled.print("CT:");
  oled.println(now.format(dtb));
  oled.print("LF:");
  DateTime lastFedDT;
  breakTime(lastFed,lastFedDT);
  oled.println(now.unixtime());
  oled.println(lastFed);
}

void loop() {
 
}
7
FTFY:

union cracked_float_t{
  float f;
  uint32_t l;
  word w[sizeof(float)/sizeof(word)];
  byte b[sizeof(float)];
};

void setup() {
  Serial.begin(115200);
  while(!Serial);
  cracked_float_t cf = {263.3};
  Serial.print(F("The float value is "));
  Serial.println(cf.f);
  Serial.print(F("The long value is "));
  Serial.println(cf.l, HEX);
  Serial.print(F("The byte value of given float is "));
  for (int i = 0; i < 4; i++) {
    Serial.print(cf.b[i], HEX);
    Serial.print(" ");
  }
  Serial.println();
  word loWord = cf.w[0];
  word hiWord = cf.w[1];
  Serial.print(F("The low word is "));
  Serial.println(loWord, HEX);
  Serial.print(F("The high word is "));
  Serial.println(hiWord, HEX);
}

void loop() { }


Don't make all of your variables global. Limit their scope. You just defeated the entire point of using a union by manually constructing words from bytes.

Use code tags when posting code, the code you posted is unreadable, and the [i] was interpreted as a BBCode italics tag.
8
Software / Re: controllo temperature con ...
Last post by MarcoMix - Today at 02:29 pm
Finalmente sono riuscito ad inviare i vari valori alla seriale denominati con t1, t2,t3,t4,t5
Ora arriva la parte più complessa: come fare l'interfaccia grafica per vedere i vari dati.
Nel primo post avevo detto che volevo usare visual studio perché sono già in grado di utilizzare dei pulsanti virtuali per comandare Arduino, ma leggendo in giro per il forum ho visto anche Python come possibile linguaggio
L'obbiettivo di questo progetto è poter vedere i vari dati dei sensori di temperatura e successivamente creare sul programma un avviso acustico quando si raggiunge una determinata temperatura
Voi cosa mi consigliate di usare?
Di Python non so nulla e di visual studio poco...
Naturalmente sono ben accetti consigli e critiche per poter implementare il progetto!
Grazie a tutti!!
9
Generale / Re: lcd non si accende
Last post by stronzio - Today at 02:28 pm
me so fatto e non ce so più
10
I have new things to report after some testing. After thinking about my ground issue i plug the servo PSU with an extansion plug to the same wall plug of my pc, this way i'm sure that the 2 psu are on the same ground and it's not a issue from my house electrical ground. But as expected the problem is the same. Afte that i try to power the servo with my pc Power supply, and before that i was sure that if i try this the servo and the arduino will be on the same ground. But it doesn't change anything....... So now i realy dont now what else to try ..... If i still have this problems it means that the usb of the arduino and the servo are on differnet grounds or i'm totaly wrong from the begining and the solution has noting to do with the ground.
But still i'm full of question now and i hope that someone have the ansers for these questions :

-  Are any reason for the Usb and the molex to be on different grounds ? is it even possible ?
- If a use a capasitor between the +5V and the GND of the servo for "smoothing" the signal will the issue be fixed ? and does this solution means that i will lose some reactivity from the servo as the signal is passing through a filter ?

I now there are a lots of questions but it start to drive me crazy...... I dont see why it works preferctly when i power up the servo from the arduino and then it become  sensible to electomagnetic nose ( i assume that's what hapens when i start moving or touching metalic things) when i use and external PSU even if all the psu are to the same ground...

Pages: [1] 2 3 ... 10