Posts

Showing posts from November 19, 2018

expected identifier before '(' token on Arduino

Image
up vote -1 down vote favorite I am writing an Arduino Programm on Arduino IDE and I have a problem, it says it is called stray 313 error: expected ')' before 'if'. How can I correct it? I am very new at programming and I don´t know how to fix it. The problem is on the last "if line" Here is the sketch int LED1 = 3; int LED2 = 5; int LED3 = 6; int sensor = 0; int valor; void setup() { pinMode (LED1, OUTPUT); pinMode (LED2, OUTPUT); pinMode (LED3, OUTPUT); } void loop() { valor = analogRead (sensor); if ((valor ˃ 0) && (valor ˂ 170)) { analogWrite (LED1, 127); analogWrite (LED2, 0); analogWrite (LED3, 0); } if ((valor ˃= 170) && (valor ˂ 340)) { analogWrite (LED1, 255); analogWrite (LED2, 0); analogWrite (LED3, 0); } if ((v

CUDA C + MEAN FILTER + SYNC/ASYNC ERRORS

Image
up vote -1 down vote favorite I'm trying to produce a mean filter of sliding window 3 x 3. I'm inputting a 16 x 16 array (arrays16.txt --> int matrix) and trying to allocate 16 x 16 threads for each block (1 block right now). Using cuda-memcheck i'm receiving a number of sync/async errors and I have been going around and around. Is there something obviously wrong? I understand it is some sort of segfault and probably an issue with my pointers but I can't seem to get past it.Using cuda-memcheck with the -lineinfo flag it seems to be happening in the loop in the kernel. Here is my code, thank you: #include <stdio.h> #include <time.h> #include <cuda.h> #include <cuda_runtime.h> #include <stdlib.h> #define MAXR 16 #define MAXC 16 __global__ void imagefilter(float ** intermed