-3

I have managed to "translate" an entire code written in C to LUA, the source code permits to drive an 5110/3110 LCD and I have tried not to modify the code, but the port names, because I will run it on a router and use the LED as GPIO pins. Anyway... I've been translating about 3 hours and now I'm done, but it wont run, it shows me errors, wherer I can't find one... For me it seems good.

C Source: http://www.est.ipcb.pt/pessoais/alexandre_t/fon_LCD/3310_ex_1.c My translated LUA Script: https://gist.github.com/anonymous/62cc0897ede3cb788baa

The first error it gives me ìs that Screen.lua:26: '(' expected near 'local' But there don't seem to be an error... If anyone could revise my code and point me forward, I would be very glad.

Fusseldieb
  • 1,324
  • 2
  • 19
  • 44

1 Answers1

1

The error seems pretty obvious based on the error message. Missing ( exactly as the error message says at exactly the line it says.

function posicao
    local x1=0
    ...
end

Should be

function posicao()
    local x1=0
    ...
end
kaylum
  • 13,833
  • 2
  • 22
  • 31
  • Thanks. That was the error, but now I'm stuck at line 146. At that line seems all perfect... It has the () and so on... I don't know... Error: ` '(' expected near 'f_A' ` – Fusseldieb Sep 04 '15 at 04:13
  • Have you fixed up all your functions? You have the same error in multiple function definitions. e.g. `clearram` and `initlcd`. Also, I think you are getting downvotes because you are supposed to put the code into the question and not as an external link (links can go away and then this question will be useless to future readers). – kaylum Sep 04 '15 at 04:17
  • I fixed all those functions with missing (). Sorry about the links, I always post here, but this time, the code is too big. It would be very annoying. – Fusseldieb Sep 04 '15 at 04:18
  • It really don't seem to be an issue on that line 146... But still...thee's an error and I am clueless. – Fusseldieb Sep 04 '15 at 04:19
  • Update the code. Need to see the exact code as don't know what state you have it in now. – kaylum Sep 04 '15 at 04:28
  • I just fixed the () on the functions – Fusseldieb Sep 04 '15 at 18:34
  • That's what you think you've done. What if you missed some? What if you mistyped one of them? What if ..? By definition you aren't able to see what the problem is so there is no way you would say something like "I fixed all the functions except one" even when that is in fact what you did (just an example). So when someone says "post the code" they are looking to verify what you said with what the code is really like. No one can debug a "description of code". – kaylum Sep 05 '15 at 06:31
  • Oh, I really missed one () ... Now the code runs, but the LCD shows nothing....Is there an error beteeen LUA and C? – Fusseldieb Sep 05 '15 at 06:39