Hi, okay, it worked.
But i still get no plain start Scetch.
The Sketch that is loaded after mblock starts looks like this:
#include <Arduino.h> #include <Wire.h> #include <SoftwareSerial.h> double angle_rad = PI/180.0; double angle_deg = 180.0/PI; void setup(){ pinMode("a0",INPUT); } void loop(){ if(digitalRead("a0")){ }else{ } _loop(); } void _delay(float seconds){ long endTime = millis() + seconds * 1000; while(millis() < endTime)_loop(); } void _loop(){ }
I was looking for something like:
setup(...my code...) loop( ...my code...)
I now worked around it. But for future work with school-classes it’s a bit confusing, if they see code, they didn’t write.
**I have another question for you: @bigeyex **
The littlebits arduino-bit has three inputs and three outputs. Two of them are labeld A0
and A1
the rest is labeled 0
1
…9
.
How can i add the A0
and A1
pin-labels to my JSON file and as option in my custom-made blocks?
Look here for example: https://littlebits.com/tips-tricks/tips-tricks-arduino-module
I can work around it with manually editing the arduino code. But i want my pupils to just program with the blocks in the mblock app.
Thanks!