This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package math; | |
| import java.util.ArrayList; | |
| /** | |
| * Hittar primtal. | |
| * Kollar bara ojämna tal, jämför genom att kolla om talet som ska undersökas är delbart med tidigare hittade primtal. | |
| * Om ja är det inte ett primtal. Om nej måste det vara det. | |
| * Kollar också om talets komponenter summeras till 3, om så kan det inte vara ett primtal. | |
| * Kollar bara tal som inte slutar på 5. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Labb1 { | |
| public static int length = 1; | |
| public static int n; | |
| public static void main(String args[]) { | |
| count(2); | |
| String _n = "101"; | |
| n = _n.length(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const int trigPin = 4; | |
| const int echoPin = 2; | |
| void setup(){ | |
| Serial.begin(9600); | |
| pinMode(trigPin, OUTPUT); | |
| pinMode(echoPin, INPUT); | |
| } | |
| void loop() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "LedControlMS.h" | |
| #include <math.h> | |
| #include <stdlib.h> | |
| #include <stdbool.h> | |
| #define NBR_MTX 2 | |
| LedControl lc=LedControl(12,11,10, NBR_MTX); | |
| int speed = 100; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "LedControlMS.h" | |
| #include <math.h> | |
| #include <stdlib.h> | |
| #include <stdbool.h> | |
| #define NBR_MTX 2 | |
| LedControl lc=LedControl(12,11,10, NBR_MTX); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * snake.ino | |
| * | |
| * A simple snake game. | |
| * When a player hits the wall or the tail of the snake, the score flashes on the screen. | |
| * | |
| * This code is written for use with a 8x8 led matrix, controlled by a MAX7219 | |
| * | |
| * Remember to download and include LedControlMS from |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * STM32F303 | |
| * RX-> PD8 | |
| * TX-> PD9 | |
| * Baud 9600 (standard) | |
| * 0.1 | |
| */ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * STM32F303 | |
| * RX-> PD8 | |
| * TX-> PD9 | |
| * Baud 9600 (standard) | |
| * 0.1 | |
| */ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Interrupt handle and task for PWM-in. | |
| @Author: Hannes Paulsson, Ramon Rodriguez | |
| Channels on controller: | |
| 1 : Roll | |
| 2 : Thrust | |
| 3 : Pitch | |
| 4 : Yaw |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Interrupt handle and task for PWM-in. | |
| @Author: Hannes Paulsson, Ramon Rodriguez | |
| Channels on controller: | |
| 1 : Roll | |
| 2 : Thrust | |
| 3 : Pitch | |
| 4 : Yaw |