Closed Skandan-M-M closed 3 months ago
Download the file and include it in your project's src
folder. However, these libraries will not work natively with the VSDsquadron mini. They are designed for atmega MCUs
You will most likely write the functions you need on your own. your build upon someone else's project that can be found on the VSD website
Ok, will try it
I am not able to write a library on my own. searched for many references, all other libraries are interlinked and leading to aurdino.h at the end and it is also showing up many errors in header files , I am not able to figure it out. Please help me
the code I am trying is,
// Define sensor pin const int RECV_PIN = 4;
// Define IR Receiver and Results Objects IRrecv irrecv(RECV_PIN); decode_results results;
// Define LED pin
// Enabling clock for the GPIO port
void setup() { // Initialize Serial communication for debugging Serial.begin(9600);
// Enable the IR Receiver
irrecv.enableIRIn();
// Initialize LED pin
LED_CLOCK_ENABLE;
GPIO_InitTypeDef GPIO_InitStructure;
GPIO_InitStructure.GPIO_Pin = LED_PIN_NUMBER;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(LED_PIN, &GPIO_InitStructure);
}
void loop() { // Check if IR value is received if (irrecv.decode(&results)) { // Print received IR value Serial.print("IR Value: "); Serial.println(results.value, HEX);
// If the received IR value matches the specified value
if (results.value == 0x76A77416) {
// Turn on the LED
GPIO_SetBits(LED_PIN, LED_PIN_NUMBER);
Serial.println("LED turned on.");
}
// Resume receiving IR signals
irrecv.resume();
}
}
please help me out.
Tagging @VishnuPrakashBharadwaj
Hi Vishnu,
Since you have worked with IR could you provide some pointers as to how @Skandan-M-M can approach the creation of this library
@Skandan-M-M I would suggest understanding how the Arduino library works and coding it yourself. That's the best way. There should be tutorials on how it works exactly.
Thats the approach Vishnu took
As @yathAg mentioned, you can go through the source code of IR_Remote.h / IR_Remote.c and implement similar functions. You can start with collecting raw data from the IR sensor. Here is an example of reading IR data without IR_Remote.h library in Arduino : https://github.com/mbabeysekera/advanced-arduino-ir-remote/blob/main/IR_RemoteDecoder.ino You can go through this and implement the same for VSDSquadron-Mini board.
Will try doing this , thank you
I am trying to add IRremote.h file which aurdino supports, I am not getting to know how to use this with minisquadron. I tried downloading few similar libraries from registry, but even that didnt work.